aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-15 11:07:03 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-15 11:07:03 -0500
commit8234b65afa92215ae0ed965811ac20c8b3a1806a (patch)
tree68b14dbbe0dadc81d4f3d6dec0ab675bf48e4994
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.
-rw-r--r--arch/sparc/kernel/time.c9
-rw-r--r--arch/sparc64/kernel/ktlb.S6
2 files changed, 13 insertions, 2 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.
diff --git a/arch/sparc64/kernel/ktlb.S b/arch/sparc64/kernel/ktlb.S
index 964527d2ffa0..cef8defcd7a9 100644
--- a/arch/sparc64/kernel/ktlb.S
+++ b/arch/sparc64/kernel/ktlb.S
@@ -1,6 +1,6 @@
1/* arch/sparc64/kernel/ktlb.S: Kernel mapping TLB miss handling. 1/* arch/sparc64/kernel/ktlb.S: Kernel mapping TLB miss handling.
2 * 2 *
3 * Copyright (C) 1995, 1997, 2005 David S. Miller <davem@davemloft.net> 3 * Copyright (C) 1995, 1997, 2005, 2008 David S. Miller <davem@davemloft.net>
4 * Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de) 4 * Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de)
5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx) 5 * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
6 * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 6 * Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -226,6 +226,7 @@ kvmap_dtlb_load:
226 ba,pt %xcc, sun4v_dtlb_load 226 ba,pt %xcc, sun4v_dtlb_load
227 mov %g5, %g3 227 mov %g5, %g3
228 228
229#ifdef CONFIG_SPARSEMEM_VMEMMAP
229kvmap_vmemmap: 230kvmap_vmemmap:
230 sub %g4, %g5, %g5 231 sub %g4, %g5, %g5
231 srlx %g5, 22, %g5 232 srlx %g5, 22, %g5
@@ -234,6 +235,7 @@ kvmap_vmemmap:
234 or %g1, %lo(vmemmap_table), %g1 235 or %g1, %lo(vmemmap_table), %g1
235 ba,pt %xcc, kvmap_dtlb_load 236 ba,pt %xcc, kvmap_dtlb_load
236 ldx [%g1 + %g5], %g5 237 ldx [%g1 + %g5], %g5
238#endif
237 239
238kvmap_dtlb_nonlinear: 240kvmap_dtlb_nonlinear:
239 /* Catch kernel NULL pointer derefs. */ 241 /* Catch kernel NULL pointer derefs. */
@@ -242,12 +244,14 @@ kvmap_dtlb_nonlinear:
242 bleu,pn %xcc, kvmap_dtlb_longpath 244 bleu,pn %xcc, kvmap_dtlb_longpath
243 nop 245 nop
244 246
247#ifdef CONFIG_SPARSEMEM_VMEMMAP
245 /* Do not use the TSB for vmemmap. */ 248 /* Do not use the TSB for vmemmap. */
246 mov (VMEMMAP_BASE >> 24), %g5 249 mov (VMEMMAP_BASE >> 24), %g5
247 sllx %g5, 24, %g5 250 sllx %g5, 24, %g5
248 cmp %g4,%g5 251 cmp %g4,%g5
249 bgeu,pn %xcc, kvmap_vmemmap 252 bgeu,pn %xcc, kvmap_vmemmap
250 nop 253 nop
254#endif
251 255
252 KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load) 256 KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
253 257