Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 general clean up. should not affec...



details:   https://anonhg.NetBSD.org/src/rev/e55f72a3e59a
branches:  trunk
changeset: 535219:e55f72a3e59a
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Aug 12 12:04:31 2002 +0000

description:
general clean up.  should not affect anything.  (this is part of a patch
from eeh to reduce frivolous cache flushes.)

diffstat:

 sys/arch/sparc64/sparc64/pmap.c |  86 +++++++++++++++++-----------------------
 1 files changed, 36 insertions(+), 50 deletions(-)

diffs (180 lines):

diff -r 1760330111f1 -r e55f72a3e59a sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Mon Aug 12 09:19:00 2002 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Mon Aug 12 12:04:31 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.124 2002/06/24 18:48:15 eeh Exp $   */
+/*     $NetBSD: pmap.c,v 1.125 2002/08/12 12:04:31 mrg Exp $   */
 #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define        HWREF
 /*
@@ -1943,8 +1943,6 @@
 #endif
 #ifdef DEBUG        
        enter_stats.unmanaged ++;
-#endif
-#ifdef DEBUG
        if (pa & (PMAP_NVC|PMAP_NC)) 
                enter_stats.ci ++;
 #endif
@@ -1973,20 +1971,18 @@
        }
 #ifdef DEBUG
        i = ptelookup_va(va);
-       if( pmapdebug & PDB_ENTER )
-               prom_printf("pmap_kenter_pa: va=%08x tag=%x:%08x data=%08x:%08x tsb[%d]=%08x\r\n", va,
-                           (int)(tte.tag>>32), (int)tte.tag, 
-                           (int)(tte.data>>32), (int)tte.data, 
-                           i, &tsb[i]);
-       if( pmapdebug & PDB_MMU_STEAL && tsb[i].data ) {
-               prom_printf("pmap_kenter_pa: evicting entry tag=%x:%08x data=%08x:%08x tsb[%d]=%08x\r\n",
-                           (int)(tsb[i].tag>>32), (int)tsb[i].tag, 
-                           (int)(tsb[i].data>>32), (int)tsb[i].data, 
-                           i, &tsb[i]);
-               prom_printf("with va=%08x tag=%x:%08x data=%08x:%08x tsb[%d]=%08x\r\n", va,
-                           (int)(tte.tag>>32), (int)tte.tag, 
-                           (int)(tte.data>>32), (int)tte.data, 
-                           i, &tsb[i]);
+       if (pmapdebug & PDB_ENTER)
+               prom_printf("pmap_kenter_pa: va=%08x data=%08x:%08x "
+                       "tsb[%d]=%08x\r\n", va, (int)(tte.data>>32), 
+                       (int)tte.data, i, &tsb[i]);
+       if (pmapdebug & PDB_MMU_STEAL && tsb[i].data) {
+               prom_printf("pmap_kenter_pa: evicting entry tag=%x:%08x "
+                       "data=%08x:%08x tsb[%d]=%08x\r\n",
+                       (int)(tsb[i].tag>>32), (int)tsb[i].tag,
+                       (int)(tsb[i].data>>32), (int)tsb[i].data,
+                       i, &tsb[i]);
+               prom_printf("with va=%08x data=%08x:%08x tsb[%d]=%08x\r\n", 
+                       va, (int)(tte.data>>32), (int)tte.data, i, &tsb[i]);
        }
 #endif
 #if 0
@@ -2003,15 +1999,6 @@
  *     Remove a mapping entered with pmap_kenter_pa() starting at va,
  *     for size bytes (assumed to be page rounded).
  */
-#if 0
-void
-pmap_kremove(va, size)
-       vaddr_t va;
-       vsize_t size;
-{
-       return pmap_remove(pmap_kernel(), va, va+size);
-}
-#else
 void
 pmap_kremove(va, size)
        vaddr_t va;
@@ -2101,7 +2088,6 @@
        simple_unlock(&pm->pm_lock);
        splx(s);
 }
-#endif
 
 /*
  * Insert physical page at pa into the given pmap at virtual address va.
@@ -2117,7 +2103,7 @@
 {
        pte_t tte;
        paddr_t pg;
-       int i, s, aliased = 0;
+       int i, s, uncached = 0;
        pv_entry_t pv = NULL;
        int size = 0; /* PMAP_SZ_TO_TTE(pa); */
        boolean_t wired = (flags & PMAP_WIRED) != 0;
@@ -2153,7 +2139,7 @@
         */
        if (IS_VM_PHYSADDR(pa)) {
                pv = pa_to_pvh(pa);
-               aliased = (pv->pv_va&(PV_ALIAS|PV_NVC));
+               uncached = (pv->pv_va & (PV_ALIAS|PV_NVC));
 #ifdef DIAGNOSTIC
                if ((flags & VM_PROT_ALL) & ~prot)
                        panic("pmap_enter: access_type exceeds prot");
@@ -2170,18 +2156,18 @@
 #ifdef DEBUG        
                enter_stats.unmanaged ++;
 #endif
-               aliased = 0;
+               uncached = 0;
        }
-       if (pa & PMAP_NVC) aliased = 1;
+       if (pa & PMAP_NVC) uncached = 1;
 #ifdef NO_VCACHE
-       aliased = 1; /* Disable D$ */
+       uncached = 1; /* Disable D$ */
 #endif
 #ifdef DEBUG
        enter_stats.ci ++;
 #endif
        tte.data = TSB_DATA(0, size, pa, pm == pmap_kernel(),
                (flags & VM_PROT_WRITE), (!(pa & PMAP_NC)), 
-               aliased, 1, (pa & PMAP_LITTLE));
+               uncached, 1, (pa & PMAP_LITTLE));
 #ifdef HWREF
        if (prot & VM_PROT_WRITE) tte.data |= TLB_REAL_W;
 #else
@@ -2231,20 +2217,17 @@
        splx(s);
        i = ptelookup_va(va);
 #ifdef DEBUG
-       if( pmapdebug & PDB_ENTER )
-               prom_printf("pmap_enter: va=%08x tag=%x:%08x data=%08x:%08x tsb[%d]=%08x\r\n", va,
-                           (int)(tte.tag>>32), (int)tte.tag, 
-                           (int)(tte.data>>32), (int)tte.data, 
-                           i, &tsb[i]);
-       if( pmapdebug & PDB_MMU_STEAL && tsb[i].data ) {
-               prom_printf("pmap_enter: evicting entry tag=%x:%08x data=%08x:%08x tsb[%d]=%08x\r\n",
-                           (int)(tsb[i].tag>>32), (int)tsb[i].tag, 
-                           (int)(tsb[i].data>>32), (int)tsb[i].data, 
-                           i, &tsb[i]);
-               prom_printf("with va=%08x tag=%x:%08x data=%08x:%08x tsb[%d]=%08x\r\n", va,
-                           (int)(tte.tag>>32), (int)tte.tag, 
-                           (int)(tte.data>>32), (int)tte.data, 
-                           i, &tsb[i]);
+       if (pmapdebug & PDB_ENTER)
+               prom_printf("pmap_enter: va=%08x data=%08x:%08x "
+                       "tsb[%d]=%08x\r\n", va, (int)(tte.data>>32), 
+                       (int)tte.data, i, &tsb[i]);
+       if (pmapdebug & PDB_MMU_STEAL && tsb[i].data) {
+               prom_printf("pmap_enter: evicting entry tag=%x:%08x "
+                       "data=%08x:%08x tsb[%d]=%08x\r\n",
+                       (int)(tsb[i].tag>>32), (int)tsb[i].tag,
+                       (int)(tsb[i].data>>32), (int)tsb[i].data, i, &tsb[i]);
+               prom_printf("with va=%08x data=%08x:%08x tsb[%d]=%08x\r\n", 
+                       va, (int)(tte.data>>32), (int)tte.data, i, &tsb[i]);
        }
 #endif
        if (pm->pm_ctx || pm == pmap_kernel()) {
@@ -2909,9 +2892,12 @@
                                                PV_VAMASK))
                                        tsb[i].data = 0;
 /*
+ * XXX I forget if removing this was an optimization or 
+ * workaround for UBC/UVM wierdness.
+ 
                                tlb_flush_pte(pv->pv_va&PV_VAMASK, 
                                        pv->pv_pmap->pm_ctx);
-*/
+ */
                        }
                        if (pv->pv_va & PV_REF)
                                changed |= 1;
@@ -3491,7 +3477,7 @@
                         * XXX - I haven't seen the pages uncached since
                         * XXX - using pmap_prefer().   mhitch
                         */
-                       if ((pv->pv_va^va)&VA_ALIAS_MASK) {
+                       if ((pv->pv_va ^ va) & VA_ALIAS_MASK) {
                                pv->pv_va |= PV_ALIAS;
                                pmap_page_cache(pmap, pa, 0);
 #ifdef DEBUG
@@ -3646,7 +3632,7 @@
        if (opv->pv_va & PV_ALIAS) {
                opv->pv_va &= ~PV_ALIAS;
                for (npv = opv; npv; npv = npv->pv_next) {
-                       if ((npv->pv_va^opv->pv_va)&VA_ALIAS_MASK) {
+                       if ((npv->pv_va ^ opv->pv_va) & VA_ALIAS_MASK) {
                                opv->pv_va |= PV_ALIAS;
                        }
                }



Home | Main Index | Thread Index | Old Index