diff options
-rw-r--r-- | sys/alpha/alpha/pmap.c | 3 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 8 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 8 | ||||
-rw-r--r-- | sys/ia64/ia64/pmap.c | 3 | ||||
-rw-r--r-- | sys/sparc64/include/pmap.h | 2 | ||||
-rw-r--r-- | sys/vm/pmap.h | 1 |
6 files changed, 13 insertions, 12 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index f59ec6e..5451a00 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -330,7 +330,6 @@ static pv_entry_t get_pv_entry(void); static void alpha_protection_init(void); static void pmap_changebit(vm_page_t m, int bit, boolean_t setem); -static void pmap_remove_all(vm_page_t m); static vm_page_t pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte); static int pmap_remove_pte(pmap_t pmap, pt_entry_t* ptq, vm_offset_t sva); @@ -1933,7 +1932,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) * pmap_remove (slow...) */ -static void +void pmap_remove_all(vm_page_t m) { register pv_entry_t pv; diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 1a8c53e..e783b28 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -203,7 +203,6 @@ static pv_entry_t get_pv_entry(void); static void i386_protection_init(void); static __inline void pmap_changebit(vm_page_t m, int bit, boolean_t setem); -static void pmap_remove_all(vm_page_t m); static vm_page_t pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva); @@ -1893,7 +1892,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) * pmap_remove (slow...) */ -static void +void pmap_remove_all(vm_page_t m) { register pv_entry_t pv; @@ -3067,7 +3066,8 @@ pmap_changebit(vm_page_t m, int bit, boolean_t setem) register pt_entry_t *pte; int s; - if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) + if (!pmap_initialized || (m->flags & PG_FICTITIOUS) || + (!setem && bit == PG_RW && (m->flags & PG_WRITEABLE) == 0)) return; s = splvm(); @@ -3112,6 +3112,8 @@ pmap_changebit(vm_page_t m, int bit, boolean_t setem) } } } + if (!setem && bit == PG_RW) + vm_page_flag_clear(m, PG_WRITEABLE); splx(s); } diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 1a8c53e..e783b28 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -203,7 +203,6 @@ static pv_entry_t get_pv_entry(void); static void i386_protection_init(void); static __inline void pmap_changebit(vm_page_t m, int bit, boolean_t setem); -static void pmap_remove_all(vm_page_t m); static vm_page_t pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte); static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva); @@ -1893,7 +1892,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) * pmap_remove (slow...) */ -static void +void pmap_remove_all(vm_page_t m) { register pv_entry_t pv; @@ -3067,7 +3066,8 @@ pmap_changebit(vm_page_t m, int bit, boolean_t setem) register pt_entry_t *pte; int s; - if (!pmap_initialized || (m->flags & PG_FICTITIOUS)) + if (!pmap_initialized || (m->flags & PG_FICTITIOUS) || + (!setem && bit == PG_RW && (m->flags & PG_WRITEABLE) == 0)) return; s = splvm(); @@ -3112,6 +3112,8 @@ pmap_changebit(vm_page_t m, int bit, boolean_t setem) } } } + if (!setem && bit == PG_RW) + vm_page_flag_clear(m, PG_WRITEABLE); splx(s); } diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index ad02c93..a36a776 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -257,7 +257,6 @@ static pv_entry_t get_pv_entry(void); static void ia64_protection_init(void); static void pmap_invalidate_all(pmap_t pmap); -static void pmap_remove_all(vm_page_t m); static void pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m); vm_offset_t @@ -1537,7 +1536,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) * pmap_remove (slow...) */ -static void +void pmap_remove_all(vm_page_t m) { pmap_t oldpmap; diff --git a/sys/sparc64/include/pmap.h b/sys/sparc64/include/pmap.h index 0408d41..faa3651 100644 --- a/sys/sparc64/include/pmap.h +++ b/sys/sparc64/include/pmap.h @@ -92,8 +92,6 @@ int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, void pmap_map_tsb(void); -void pmap_remove_all(vm_page_t m); - void pmap_clear_write(vm_page_t m); #define vtophys(va) pmap_kextract(((vm_offset_t)(va))) diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h index 69e7122..1511e4a 100644 --- a/sys/vm/pmap.h +++ b/sys/vm/pmap.h @@ -122,6 +122,7 @@ void pmap_qenter(vm_offset_t, vm_page_t *, int); void pmap_qremove(vm_offset_t, int); void pmap_release(pmap_t); void pmap_remove(pmap_t, vm_offset_t, vm_offset_t); +void pmap_remove_all(vm_page_t m); void pmap_remove_pages(pmap_t, vm_offset_t, vm_offset_t); void pmap_zero_page(vm_page_t); void pmap_zero_page_area(vm_page_t, int off, int size); |