Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/alpha Save ourselves some work in some pv list trav...



details:   https://anonhg.NetBSD.org/src/rev/99f765f24844
branches:  trunk
changeset: 473174:99f765f24844
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun May 23 17:49:07 1999 +0000

description:
Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.

diffstat:

 sys/arch/alpha/alpha/pmap.c   |  25 ++++++++++++-------------
 sys/arch/alpha/include/pmap.h |   3 ++-
 2 files changed, 14 insertions(+), 14 deletions(-)

diffs (116 lines):

diff -r 22e9ccd126a2 -r 99f765f24844 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Sun May 23 16:54:43 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Sun May 23 17:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.96 1999/05/23 16:54:43 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.97 1999/05/23 17:49:07 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.96 1999/05/23 16:54:43 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.97 1999/05/23 17:49:07 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -496,7 +496,7 @@
 /*
  * PV table management functions.
  */
-void   pmap_pv_enter __P((pmap_t, paddr_t, vaddr_t, boolean_t));
+void   pmap_pv_enter __P((pmap_t, paddr_t, vaddr_t, pt_entry_t *, boolean_t));
 void   pmap_pv_remove __P((pmap_t, paddr_t, vaddr_t, boolean_t,
            struct pv_entry **));
 struct pv_entry *pmap_pv_alloc __P((void));
@@ -1395,20 +1395,17 @@
        simple_lock(&pvh->pvh_slock);
        s = splimp();                   /* XXX needed w/ PMAP_NEW? */
        for (pv = LIST_FIRST(&pvh->pvh_list); pv != NULL; pv = nextpv) {
-               pt_entry_t *pte;
-
                nextpv = LIST_NEXT(pv, pv_list);
 
                simple_lock(&pv->pv_pmap->pm_slock);
-               pte = pmap_l3pte(pv->pv_pmap, pv->pv_va, NULL);
 #ifdef DEBUG
                if (pmap_pte_v(pmap_l2pte(pv->pv_pmap, pv->pv_va, NULL)) == 0 ||
-                   pmap_pte_pa(pte) != pa)
+                   pmap_pte_pa(pv->pv_pte) != pa)
                        panic("pmap_page_protect: bad mapping");
 #endif
-               if (!pmap_pte_w(pte))
+               if (pmap_pte_w(pv->pv_pte) == 0)
                        needisync |= pmap_remove_mapping(pv->pv_pmap,
-                           pv->pv_va, pte, FALSE, cpu_id, NULL);
+                           pv->pv_va, pv->pv_pte, FALSE, cpu_id, NULL);
 #ifdef DEBUG
                else {
                        if (pmapdebug & PDB_PARANOIA) {
@@ -1723,7 +1720,7 @@
         */
        if (managed) {
                int s = splimp();       /* XXX needed w/ PMAP_NEW? */
-               pmap_pv_enter(pmap, pa, va, TRUE);
+               pmap_pv_enter(pmap, pa, va, pte, TRUE);
                splx(s);
        }
 
@@ -2753,7 +2750,7 @@
 
                simple_lock(&pv->pv_pmap->pm_slock);
 
-               pte = pmap_l3pte(pv->pv_pmap, va, NULL);
+               pte = pv->pv_pte;
                npte = (*pte | set) & mask;
                if (*pte != npte) {
                        hadasm = (pmap_pte_asm(pte) != 0);
@@ -2987,10 +2984,11 @@
  *     Add a physical->virtual entry to the pv_table.
  */
 void
-pmap_pv_enter(pmap, pa, va, dolock)
+pmap_pv_enter(pmap, pa, va, pte, dolock)
        pmap_t pmap;
        paddr_t pa;
        vaddr_t va;
+       pt_entry_t *pte;
        boolean_t dolock;
 {
        struct pv_head *pvh;
@@ -3002,6 +3000,7 @@
        newpv = pmap_pv_alloc();
        newpv->pv_va = va;
        newpv->pv_pmap = pmap;
+       newpv->pv_pte = pte;
 
        pvh = pa_to_pvh(pa);
 
@@ -3134,7 +3133,7 @@
                                if (simple_lock_try(&pvpmap->pm_slock) == 0)
                                        continue;
 
-                               pte = pmap_l3pte(pvpmap, pv->pv_va, NULL);
+                               pte = pv->pv_pte;
 
                                /* Don't steal wired mappings. */
                                if (pmap_pte_w(pte)) {
diff -r 22e9ccd126a2 -r 99f765f24844 sys/arch/alpha/include/pmap.h
--- a/sys/arch/alpha/include/pmap.h     Sun May 23 16:54:43 1999 +0000
+++ b/sys/arch/alpha/include/pmap.h     Sun May 23 17:49:07 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.28 1999/05/21 23:08:00 thorpej Exp $ */
+/* $NetBSD: pmap.h,v 1.29 1999/05/23 17:49:08 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -131,6 +131,7 @@
        LIST_ENTRY(pv_entry) pv_list;   /* pv_entry list */
        struct pmap     *pv_pmap;       /* pmap where mapping lies */
        vaddr_t         pv_va;          /* virtual address for mapping */
+       pt_entry_t      *pv_pte;        /* PTE that maps the VA */
 } *pv_entry_t;
 
 /*



Home | Main Index | Thread Index | Old Index