Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm32/arm32 Repeat after me:



details:   https://anonhg.NetBSD.org/src/rev/fc6862d4cd34
branches:  trunk
changeset: 467344:fc6862d4cd34
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Tue Mar 23 13:27:48 1999 +0000

description:
Repeat after me:
If we're doing modified bit emulation, we must revoke write permission in
pmap_clear_modify().  This is non-negotiable.  I will revoke write permission
in pmap_clear_modify(), or suffer the wrath of a thousand bricks.

diffstat:

 sys/arch/arm32/arm32/pmap.c |  24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diffs (78 lines):

diff -r a68d95f4af51 -r fc6862d4cd34 sys/arch/arm32/arm32/pmap.c
--- a/sys/arch/arm32/arm32/pmap.c       Tue Mar 23 12:30:45 1999 +0000
+++ b/sys/arch/arm32/arm32/pmap.c       Tue Mar 23 13:27:48 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.43 1999/03/23 12:30:45 mycroft Exp $        */
+/*     $NetBSD: pmap.c,v 1.44 1999/03/23 13:27:48 mycroft Exp $        */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -2623,8 +2623,8 @@
         * Clear saved attributes (modify, reference)
         */
 
-       if (~maskbits)
-               vm_physmem[bank].pmseg.attrs[off] &= maskbits;
+       if (maskbits)
+               vm_physmem[bank].pmseg.attrs[off] &= ~maskbits;
 
        /*
         * Loop over all current mappings setting/clearing as appropos
@@ -2636,7 +2636,7 @@
                        /*
                         * XXX don't write protect pager mappings
                         */
-                       if (maskbits == ~PT_Wr) {
+                       if (maskbits & (PT_Wr|PT_M|PT_H)) {
 #if defined(UVM)
                                 if (va >= uvm.pager_sva && va < uvm.pager_eva)
                                        continue;
@@ -2648,16 +2648,16 @@
 #endif
                        }
 
-                       pv->pv_flags = (pv->pv_flags & maskbits) | setbits;
+                       pv->pv_flags = (pv->pv_flags & ~maskbits) | setbits;
                        pte = pmap_pte(pv->pv_pmap, va);
-                       if ((maskbits & PT_Wr) == 0)
+                       if (maskbits & (PT_Wr|PT_M))
                                *pte = (*pte) & ~PT_AP(AP_W);
                        if (setbits & PT_Wr)
                                *pte = (*pte) | PT_AP(AP_W);
-/*
-                       if ((maskbits & PT_H) == 0)
+#if 0
+                       if (maskbits & PT_H)
                                *pte = ((*pte) & ~L2_MASK) | L2_INVAL;
-*/
+#endif
                }
                cpu_tlb_flushID();
        }
@@ -2670,7 +2670,7 @@
        vm_offset_t pa;
 {
        PDEBUG(0, printf("pmap_clear_modify pa=%08lx\n", pa));
-       pmap_changebit(pa, 0, ~PT_M);
+       pmap_changebit(pa, 0, PT_M);
 }
 
 
@@ -2679,7 +2679,7 @@
        vm_offset_t pa;
 {
        PDEBUG(0, printf("pmap_clear_reference pa=%08lx\n", pa));
-       pmap_changebit(pa, 0, ~PT_H);
+       pmap_changebit(pa, 0, PT_H);
 }
 
 
@@ -2688,7 +2688,7 @@
        vm_offset_t pa;
 {
        PDEBUG(0, printf("pmap_copy_on_write pa=%08lx\n", pa));
-       pmap_changebit(pa, 0, ~PT_Wr);
+       pmap_changebit(pa, 0, PT_Wr);
 }
 
 boolean_t



Home | Main Index | Thread Index | Old Index