Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64 - re-introduce sp_tlb_flush_pte() and sp_tl...



details:   https://anonhg.NetBSD.org/src/rev/b29a4d257cca
branches:  trunk
changeset: 752342:b29a4d257cca
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Feb 24 01:58:52 2010 +0000

description:
- re-introduce sp_tlb_flush_pte() and sp_tlb_flush_all() that call
  the right USI/USIII version.
- define tlb_flush_pte() in terms of sp_tlb_flush_pte() for the
  !MULTIPROCESSOR case

this centralises some CPU_IS_USIII_UP() tests.

diffstat:

 sys/arch/sparc64/include/pmap.h     |  29 ++++++++++++++++++++---------
 sys/arch/sparc64/sparc64/ipifuncs.c |  12 ++++--------
 sys/arch/sparc64/sparc64/locore.s   |   5 +++--
 sys/arch/sparc64/sparc64/pmap.c     |  17 +++++------------
 4 files changed, 32 insertions(+), 31 deletions(-)

diffs (144 lines):

diff -r c83de8dadd9f -r b29a4d257cca sys/arch/sparc64/include/pmap.h
--- a/sys/arch/sparc64/include/pmap.h   Wed Feb 24 00:01:11 2010 +0000
+++ b/sys/arch/sparc64/include/pmap.h   Wed Feb 24 01:58:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.48 2010/02/23 22:52:21 mrg Exp $    */
+/*     $NetBSD: pmap.h,v 1.49 2010/02/24 01:58:52 mrg Exp $    */
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -211,18 +211,29 @@
 void sp_tlb_flush_all_us(void);
 void sp_tlb_flush_all_usiii(void);
 
+static __inline__ void
+sp_tlb_flush_pte(vaddr_t va, int ctx)
+{
+       if (CPU_IS_USIII_UP())
+               sp_tlb_flush_pte_usiii(va, ctx);
+       else
+               sp_tlb_flush_pte_us(va, ctx);
+}
+
+static __inline__ void
+sp_tlb_flush_all(void)
+{
+       if (CPU_IS_USIII_UP())
+               sp_tlb_flush_all_usiii();
+       else
+               sp_tlb_flush_all_us();
+}
+
 #ifdef MULTIPROCESSOR
 void smp_tlb_flush_pte(vaddr_t, pmap_t);
 #define        tlb_flush_pte(va,pm)    smp_tlb_flush_pte(va, pm)
 #else
-static __inline__ void
-tlb_flush_pte(vaddr_t va, pmap_t pm)
-{
-       if (CPU_IS_USIII_UP())
-               sp_tlb_flush_pte_usiii(va, pm->pm_ctx);
-       else
-               sp_tlb_flush_pte_us(va, pm->pm_ctx);
-}
+#define        tlb_flush_pte(va,pm)    sp_tlb_flush_pte(va, (pm)->pm_ctx)
 #endif
 
 /* Installed physical memory, as discovered during bootstrap. */
diff -r c83de8dadd9f -r b29a4d257cca sys/arch/sparc64/sparc64/ipifuncs.c
--- a/sys/arch/sparc64/sparc64/ipifuncs.c       Wed Feb 24 00:01:11 2010 +0000
+++ b/sys/arch/sparc64/sparc64/ipifuncs.c       Wed Feb 24 01:58:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipifuncs.c,v 1.31 2010/02/20 16:46:38 martin Exp $ */
+/*     $NetBSD: ipifuncs.c,v 1.32 2010/02/24 01:58:53 mrg Exp $ */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.31 2010/02/20 16:46:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipifuncs.c,v 1.32 2010/02/24 01:58:53 mrg Exp $");
 
 #include "opt_ddb.h"
 
@@ -385,12 +385,8 @@
        /* Flush our own TLB */
        ctx = pm->pm_ctx[cpu_number()];
        KASSERT(ctx >= 0);
-       if (kpm || ctx > 0) {
-               if (CPU_IS_USIII_UP())
-                       sp_tlb_flush_pte_usiii(va, ctx);
-               else
-                       sp_tlb_flush_pte_us(va, ctx);
-       }
+       if (kpm || ctx > 0)
+               sp_tlb_flush_pte(va, ctx);
 
        CPUSET_ASSIGN(cpuset, cpus_active);
        CPUSET_DEL(cpuset, cpu_number());
diff -r c83de8dadd9f -r b29a4d257cca sys/arch/sparc64/sparc64/locore.s
--- a/sys/arch/sparc64/sparc64/locore.s Wed Feb 24 00:01:11 2010 +0000
+++ b/sys/arch/sparc64/sparc64/locore.s Wed Feb 24 01:58:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.319 2010/02/22 22:28:57 mrg Exp $ */
+/*     $NetBSD: locore.s,v 1.320 2010/02/24 01:58:53 mrg Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -4965,7 +4965,8 @@
 
 
 /*
- * sp_tlb_flush_all_us(void)/sp_tlb_flush_all_usiii(void)
+ * sp_tlb_flush_all_us(void)
+ * sp_tlb_flush_all_usiii(void)
  *
  * Flush all user TLB entries from both IMMU and DMMU.
  * We have both UltraSPARC I+II, and UltraSPARC >=III versions.
diff -r c83de8dadd9f -r b29a4d257cca sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Wed Feb 24 00:01:11 2010 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Wed Feb 24 01:58:52 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.251 2010/02/13 08:56:29 mrg Exp $   */
+/*     $NetBSD: pmap.c,v 1.252 2010/02/24 01:58:53 mrg Exp $   */
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.251 2010/02/13 08:56:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.252 2010/02/24 01:58:53 mrg Exp $");
 
 #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define        HWREF
@@ -1858,12 +1858,8 @@
 #ifdef MULTIPROCESSOR
                if (wasmapped && pmap_is_on_mmu(pm))
                        tlb_flush_pte(va, pm);
-               else {
-                       if (CPU_IS_USIII_UP())
-                               sp_tlb_flush_pte_usiii(va, pmap_ctx(pm));
-                       else
-                               sp_tlb_flush_pte_us(va, pmap_ctx(pm));
-               }
+               else
+                       sp_tlb_flush_pte(va, pmap_ctx(pm));
 #else
                tlb_flush_pte(va, pm);
 #endif
@@ -3076,10 +3072,7 @@
                                clrx(&curcpu()->ci_tsb_immu[i].data);
                        }
                }
-               if (CPU_IS_USIII_UP())
-                       sp_tlb_flush_all_usiii();
-               else
-                       sp_tlb_flush_all_us();
+               sp_tlb_flush_all();
                ctx = 1;
                curcpu()->ci_pmap_next_ctx = 2;
        }



Home | Main Index | Thread Index | Old Index