Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64 for USIII, use the new "tlb demap all" oper...
details: https://anonhg.NetBSD.org/src/rev/d45678be94b5
branches: trunk
changeset: 751339:d45678be94b5
user: mrg <mrg%NetBSD.org@localhost>
date: Mon Feb 01 06:26:15 2010 +0000
description:
for USIII, use the new "tlb demap all" operation in sp_tlb_flush_all()
diffstat:
sys/arch/sparc64/include/ctlreg.h | 3 +-
sys/arch/sparc64/sparc64/locore.s | 79 +++++---------------------------------
2 files changed, 13 insertions(+), 69 deletions(-)
diffs (119 lines):
diff -r 48a943dc5e5e -r d45678be94b5 sys/arch/sparc64/include/ctlreg.h
--- a/sys/arch/sparc64/include/ctlreg.h Mon Feb 01 05:48:19 2010 +0000
+++ b/sys/arch/sparc64/include/ctlreg.h Mon Feb 01 06:26:15 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ctlreg.h,v 1.48 2009/12/05 08:00:18 nakayama Exp $ */
+/* $NetBSD: ctlreg.h,v 1.49 2010/02/01 06:26:15 mrg Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath
@@ -362,6 +362,7 @@
#define DEMAP_CTX_NUCLEUS ((0x06)<<4) /* Demap all of kernel CTXT */
#define DEMAP_CTX_PRIMARY ((0x04)<<4) /* Demap all of primary CTXT */
#define DEMAP_CTX_SECONDARY ((0x05)<<4) /* Demap all of secondary CTXT */
+#define DEMAP_ALL ((0x08)<<4) /* Demap all non-locked TLB entries [USIII] */
/*
* Interrupt registers. This really gets hairy.
diff -r 48a943dc5e5e -r d45678be94b5 sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Mon Feb 01 05:48:19 2010 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Mon Feb 01 06:26:15 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.306 2010/02/01 03:43:27 mrg Exp $ */
+/* $NetBSD: locore.s,v 1.307 2010/02/01 06:26:15 mrg Exp $ */
/*
* Copyright (c) 1996-2002 Eduardo Horvath
@@ -5322,82 +5322,25 @@
retl
wrpr %o3, %pstate
#else
- ! XXX bump up %tl around this call always
- rdpr %tl, %o4
- inc %o4
- wrpr %o4, 0, %tl
-
+ rdpr %tl, %o5
+ brnz,pt %o5, 1f
+ set DEMAP_ALL, %o2
+ wrpr 1, %tl
+1:
rdpr %pstate, %o3
andn %o3, PSTATE_IE, %o4 ! disable interrupts
wrpr %o4, 0, %pstate
- set (63 * 8), %o0 ! last TLB entry
- set CTX_PRIMARY, %o4
- ldxa [%o4] ASI_DMMU, %o4 ! save secondary context
- set CTX_MASK, %o5
- membar #Sync
-
- ! %o0 = loop counter
- ! %o1 = ctx value
- ! %o2 = TLB tag value
- ! %o3 = saved %pstate
- ! %o4 = saved primary ctx
- ! %o5 = CTX_MASK
- ! %xx = saved %tl
-
-0:
- ldxa [%o0] ASI_DMMU_TLB_TAG, %o2 ! fetch the TLB tag
- andcc %o2, %o5, %o1 ! context 0?
- bz,pt %xcc, 1f ! if so, skip
- mov CTX_PRIMARY, %o2
-
- stxa %o1, [%o2] ASI_DMMU ! set the context
- set DEMAP_CTX_PRIMARY, %o2
- membar #Sync
- stxa %o2, [%o2] ASI_DMMU_DEMAP ! do the demap
- membar #Sync
-
-1:
- dec 8, %o0
- brgz,pt %o0, 0b ! loop over all entries
- nop
-
-/*
- * now do the IMMU
- */
-
- set (63 * 8), %o0 ! last TLB entry
-
-0:
- ldxa [%o0] ASI_IMMU_TLB_TAG, %o2 ! fetch the TLB tag
- andcc %o2, %o5, %o1 ! context 0?
- bz,pt %xcc, 1f ! if so, skip
- mov CTX_PRIMARY, %o2
-
- stxa %o1, [%o2] ASI_DMMU ! set the context
- set DEMAP_CTX_PRIMARY, %o2
- membar #Sync
- stxa %o2, [%o2] ASI_IMMU_DEMAP ! do the demap
- membar #Sync
-
-1:
- dec 8, %o0
- brgz,pt %o0, 0b ! loop over all entries
- nop
-
- set CTX_PRIMARY, %o2
- stxa %o4, [%o2] ASI_DMMU ! restore secondary ctx
+
+ stxa %o2, [%o2] ASI_IMMU_DEMAP
+ stxa %o2, [%o2] ASI_DMMU_DEMAP
+
sethi %hi(KERNBASE), %o4
membar #Sync
flush %o4
- ! XXX bump up %tl around this call always
- rdpr %tl, %o4
- dec %o4
- wrpr %o4, 0, %tl
-
+ wrpr %o5, %tl
retl
wrpr %o3, %pstate
-
#endif
/*
Home |
Main Index |
Thread Index |
Old Index