diff options
author | Alan Cox <alc@FreeBSD.org> | 2009-11-27 22:08:29 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2009-11-27 22:08:29 +0000 |
commit | d8778512cf457eef1def990789bdcdcdbc66c6e0 (patch) | |
tree | b410a47195cdfe6b9e64cb333f56b68b946c0501 /sys/vm | |
parent | e2997fea729a30ca91e4a921850978421618cd38 (diff) | |
download | src-d8778512cf457eef1def990789bdcdcdbc66c6e0.tar.gz src-d8778512cf457eef1def990789bdcdcdbc66c6e0.zip |
Support the new VM_PROT_COPY option on wired pages. The effect of which
is that a debugger can now set a breakpoint in a program that uses mlock(2)
on its text segment or mlockall(2) on its entire address space.
Notes
Notes:
svn path=/head/; revision=199869
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_fault.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index 0896cbae123a..f1f13a64021b 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -273,7 +273,7 @@ RetryFault:; fs.lookup_still_valid = TRUE; if (wired) - fault_type = prot; + fault_type = prot | (fault_type & VM_PROT_COPY); fs.first_m = NULL; @@ -759,8 +759,11 @@ vnode_locked: */ pmap_copy_page(fs.m, fs.first_m); fs.first_m->valid = VM_PAGE_BITS_ALL; - } - if (fs.m) { + if (wired && (fault_flags & + VM_FAULT_CHANGE_WIRING) == 0) { + vm_page_wire(fs.first_m); + vm_page_unwire(fs.m, FALSE); + } /* * We no longer need the old page or object. */ |