summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/time.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-15 08:07:03 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-15 08:07:03 -0800
commit8234b65afa92215ae0ed965811ac20c8b3a1806a (patch)
tree68b14dbbe0dadc81d4f3d6dec0ab675bf48e4994 /arch/sparc/kernel/time.c
parent612166c76d6bd1ccd2624a15586a92444d2c4c0e (diff)
parentbf4a7972d638741bbb0672653c1fa10e4480c385 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC64]: Fix build with SPARSEMEM_VMEMMAP disabled. [SPARC]: Make gettimeofday() monotonic again.
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 45cb7c5286d..00b393c3a4a 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -436,7 +436,14 @@ void __init time_init(void)
static inline unsigned long do_gettimeoffset(void)
{
- return (*master_l10_counter >> 10) & 0x1fffff;
+ unsigned long val = *master_l10_counter;
+ unsigned long usec = (val >> 10) & 0x1fffff;
+
+ /* Limit hit? */
+ if (val & 0x80000000)
+ usec += 1000000 / HZ;
+
+ return usec;
}
/* Ok, my cute asm atomicity trick doesn't work anymore.