Mon Nov 30 05:22:55 2009 UTC ()
sp_tlb_flush_pte for cheetah:
- restore interrupts properly in case of %tl > 0.


(nakayama)
diff -r1.298 -r1.299 src/sys/arch/sparc64/sparc64/locore.s

cvs diff -r1.298 -r1.299 src/sys/arch/sparc64/sparc64/locore.s (expand / switch to unified diff)

--- src/sys/arch/sparc64/sparc64/locore.s 2009/11/30 01:58:49 1.298
+++ src/sys/arch/sparc64/sparc64/locore.s 2009/11/30 05:22:55 1.299
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.298 2009/11/30 01:58:49 mrg Exp $ */ 1/* $NetBSD: locore.s,v 1.299 2009/11/30 05:22:55 nakayama Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996-2002 Eduardo Horvath 4 * Copyright (c) 1996-2002 Eduardo Horvath
5 * Copyright (c) 1996 Paul Kranenburg 5 * Copyright (c) 1996 Paul Kranenburg
6 * Copyright (c) 1996 6 * Copyright (c) 1996
7 * The President and Fellows of Harvard College. 7 * The President and Fellows of Harvard College.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (c) 1992, 1993 9 * Copyright (c) 1992, 1993
10 * The Regents of the University of California. 10 * The Regents of the University of California.
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * This software was developed by the Computer Systems Engineering group 13 * This software was developed by the Computer Systems Engineering group
14 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 14 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
@@ -5454,34 +5454,32 @@ ENTRY(sp_tlb_flush_pte) @@ -5454,34 +5454,32 @@ ENTRY(sp_tlb_flush_pte)
5454 stxa %o1, [%o2] ASI_DMMU ! Insert context to demap 5454 stxa %o1, [%o2] ASI_DMMU ! Insert context to demap
5455 sethi %hi(KERNBASE), %o1 5455 sethi %hi(KERNBASE), %o1
5456 membar #Sync 5456 membar #Sync
5457 or %o0, DEMAP_PAGE_PRIMARY, %o0 5457 or %o0, DEMAP_PAGE_PRIMARY, %o0
5458 stxa %o0, [%o0] ASI_DMMU_DEMAP ! Do the demap 5458 stxa %o0, [%o0] ASI_DMMU_DEMAP ! Do the demap
5459 stxa %o0, [%o0] ASI_IMMU_DEMAP ! to both TLBs 5459 stxa %o0, [%o0] ASI_IMMU_DEMAP ! to both TLBs
5460#ifdef _LP64 5460#ifdef _LP64
5461 srl %o0, 0, %o0 ! and make sure it's both 32- and 64-bit entries 5461 srl %o0, 0, %o0 ! and make sure it's both 32- and 64-bit entries
5462 stxa %o0, [%o0] ASI_DMMU_DEMAP ! Do the demap 5462 stxa %o0, [%o0] ASI_DMMU_DEMAP ! Do the demap
5463 stxa %o0, [%o0] ASI_IMMU_DEMAP ! Do the demap 5463 stxa %o0, [%o0] ASI_IMMU_DEMAP ! Do the demap
5464#endif 5464#endif
5465 flush %o1 5465 flush %o1
5466 stxa %o5, [%o2] ASI_DMMU ! Restore primary context 5466 stxa %o5, [%o2] ASI_DMMU ! Restore primary context
5467 brz,pt %o3, 1f 5467 brnz,pt %o3, 1f
5468 flush %o1 5468 flush %o1
5469 retl 5469 wrpr %g0, %o3, %tl ! Return to kernel mode.
5470 nop 
54711:  54701:
5472 wrpr %o4, %pstate ! restore interrupts 
5473 retl 5471 retl
5474 wrpr %g0, %o3, %tl ! Return to kernel mode. 5472 wrpr %o4, %pstate ! restore interrupts
5475#endif 5473#endif
5476 5474
5477 5475
5478/* 5476/*
5479 * sp_tlb_flush_all(void) 5477 * sp_tlb_flush_all(void)
5480 * 5478 *
5481 * Flush all user TLB entries from both IMMU and DMMU. 5479 * Flush all user TLB entries from both IMMU and DMMU.
5482 */ 5480 */
5483 .align 8 5481 .align 8
5484ENTRY(sp_tlb_flush_all) 5482ENTRY(sp_tlb_flush_all)
5485#ifdef SPITFIRE 5483#ifdef SPITFIRE
5486 rdpr %pstate, %o3 5484 rdpr %pstate, %o3
5487 andn %o3, PSTATE_IE, %o4 ! disable interrupts 5485 andn %o3, PSTATE_IE, %o4 ! disable interrupts