summaryrefslogtreecommitdiff
path: root/board/integratorcp/integratorcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/integratorcp/integratorcp.c')
-rw-r--r--board/integratorcp/integratorcp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/board/integratorcp/integratorcp.c b/board/integratorcp/integratorcp.c
index d6d6e13..220513f 100644
--- a/board/integratorcp/integratorcp.c
+++ b/board/integratorcp/integratorcp.c
@@ -34,6 +34,7 @@
*/
#include <common.h>
+#include <div64.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -244,7 +245,11 @@ ulong get_timer_masked (void)
total_count += lastdec - now;
}
lastdec = now;
- timestamp = (ulong)(total_count/div_timer);
+
+ /* Reuse "now" */
+ now = total_count;
+ do_div(now, div_timer);
+ timestamp = now;
return timestamp;
}