Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/arch/arm/arm32 Pull up revision 1.107 (requested by...



details:   https://anonhg.NetBSD.org/src/rev/428244b3cd14
branches:  netbsd-1-6
changeset: 529376:428244b3cd14
user:      he <he%NetBSD.org@localhost>
date:      Sat Nov 16 10:03:47 2002 +0000

description:
Pull up revision 1.107 (requested by thorpej in ticket #662):
  Clean up some warts in pmap_protect().

diffstat:

 sys/arch/arm/arm32/pmap.c |  28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diffs (71 lines):

diff -r 3a997308f923 -r 428244b3cd14 sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Sat Nov 16 10:01:44 2002 +0000
+++ b/sys/arch/arm/arm32/pmap.c Sat Nov 16 10:03:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.97.4.1 2002/07/31 00:23:17 lukem Exp $      */
+/*     $NetBSD: pmap.c,v 1.97.4.2 2002/11/16 10:03:47 he Exp $ */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -143,7 +143,7 @@
 #include <machine/param.h>
 #include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.97.4.1 2002/07/31 00:23:17 lukem Exp $");        
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.97.4.2 2002/11/16 10:03:47 he Exp $");        
 #ifdef PMAP_DEBUG
 #define        PDEBUG(_lev_,_stat_) \
        if (pmap_debug_level >= (_lev_)) \
@@ -2534,18 +2534,17 @@
 {
        pt_entry_t *pte = NULL, *ptes;
        struct vm_page *pg;
-       int armprot;
        int flush = 0;
-       paddr_t pa;
 
        PDEBUG(0, printf("pmap_protect: pmap=%p %08lx->%08lx %x\n",
            pmap, sva, eva, prot));
 
        if (~prot & VM_PROT_READ) {
-               /* Just remove the mappings. */
+               /*
+                * Just remove the mappings.  pmap_update() is not required
+                * here since the caller should do it.
+                */
                pmap_remove(pmap, sva, eva);
-               /* pmap_update not needed as it should be called by the caller
-                * of pmap_protect */
                return;
        }
        if (prot & VM_PROT_WRITE) {
@@ -2596,26 +2595,17 @@
 
                flush = 1;
 
-               armprot = 0;
-               if (sva < VM_MAXUSER_ADDRESS)
-                       armprot |= L2_S_PROT_U;
-               else if (sva < VM_MAX_ADDRESS)
-                       armprot |= L2_S_PROT_W;  /* XXX Ekk what is this ? */
-               *pte = (*pte & 0xfffff00f) | armprot;
-
-               pa = pmap_pte_pa(pte);
-
-               /* Get the physical page index */
+               *pte &= ~L2_S_PROT_W;           /* clear write bit */
 
                /* Clear write flag */
-               if ((pg = PHYS_TO_VM_PAGE(pa)) != NULL) {
+               if ((pg = PHYS_TO_VM_PAGE(pmap_pte_pa(pte))) != NULL) {
                        simple_lock(&pg->mdpage.pvh_slock);
                        (void) pmap_modify_pv(pmap, sva, pg, PVF_WRITE, 0);
                        pmap_vac_me_harder(pmap, pg, ptes, FALSE);
                        simple_unlock(&pg->mdpage.pvh_slock);
                }
 
-next:
+ next:
                sva += NBPG;
                pte++;
        }



Home | Main Index | Thread Index | Old Index