diff options
author | dyson <dyson@FreeBSD.org> | 1996-12-29 02:27:07 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-12-29 02:27:07 +0000 |
commit | 6a2a246ed77070189503398f3271ae65ad03e4e9 (patch) | |
tree | 46f688159e458ce69cc002d772dab15410a52ed3 /sys/i386 | |
parent | 412ed002942f7e3ccccd462d668ad4af45295cb4 (diff) | |
download | FreeBSD-src-6a2a246ed77070189503398f3271ae65ad03e4e9.zip FreeBSD-src-6a2a246ed77070189503398f3271ae65ad03e4e9.tar.gz |
Allow pmap_protect to increase permissions. This mod can eliminate
the need for unnecessary vm_faults.
Submitted by: Alan Cox <alc@cs.rice.edu>
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/pmap.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 58a079f..6555810 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.130 1996/11/07 14:44:01 joerg Exp $ + * $Id: pmap.c,v 1.131 1996/11/11 04:20:19 dyson Exp $ */ /* @@ -1835,9 +1835,6 @@ pmap_protect(pmap, sva, eva, prot) pmap_remove(pmap, sva, eva); return; } - if (prot & VM_PROT_WRITE) { - return; - } anychanged = 0; @@ -1866,7 +1863,12 @@ pmap_protect(pmap, sva, eva, prot) unsigned pbits = ptbase[sindex]; - if (pbits & PG_RW) { + if (prot & VM_PROT_WRITE) { + if ((pbits & (PG_RW|PG_V)) == PG_V) { + ptbase[sindex] = pbits | PG_RW; + anychanged = 1; + } + } else if (pbits & PG_RW) { if (pbits & PG_M) { vm_offset_t sva = i386_ptob(sindex); if (pmap_track_modified(sva)) { |