diff options
author | alc <alc@FreeBSD.org> | 2002-11-11 05:17:34 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-11-11 05:17:34 +0000 |
commit | 78766a7b7aa74fa44d582aa014484403872cb079 (patch) | |
tree | 8d89b7506498433c395030fe085076705f8a6df2 /sys/i386 | |
parent | 8c44e1c3f9177a8442c00fad854cfda6db6d220a (diff) | |
download | FreeBSD-src-78766a7b7aa74fa44d582aa014484403872cb079.zip FreeBSD-src-78766a7b7aa74fa44d582aa014484403872cb079.tar.gz |
- Clear the page's PG_WRITEABLE flag in the i386's pmap_changebit()
if we're removing write access from the page's PTEs.
- Export pmap_remove_all() on alpha, i386, and ia64. (It's already
exported on sparc64.)
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/pmap.c | 8 |
1 files changed, 5 insertions, 3 deletions
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); } |