aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/time.c')
-rw-r--r--arch/sparc/kernel/time.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 45cb7c5286d7..00b393c3a4a0 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -436,7 +436,14 @@ void __init time_init(void)
436 436
437static inline unsigned long do_gettimeoffset(void) 437static inline unsigned long do_gettimeoffset(void)
438{ 438{
439 return (*master_l10_counter >> 10) & 0x1fffff; 439 unsigned long val = *master_l10_counter;
440 unsigned long usec = (val >> 10) & 0x1fffff;
441
442 /* Limit hit? */
443 if (val & 0x80000000)
444 usec += 1000000 / HZ;
445
446 return usec;
440} 447}
441 448
442/* Ok, my cute asm atomicity trick doesn't work anymore. 449/* Ok, my cute asm atomicity trick doesn't work anymore.