diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2003-05-26 16:25:33 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2003-05-26 16:25:33 +0000 |
commit | 3fcb99ebca01fead53557ba5bc81cde5a67564a0 (patch) | |
tree | fdd7ddfdcfc56bb8b26097447d56ae841a3c6f31 | |
parent | 39609c0a00b7d70995bdfc70fe4d5aabe68ea03a (diff) |
pmap_protect strikes again.
Not only do we have to think about PROT_EXEC while dealing with it, but we
also have to think about wiring. sigh.
We'll have to fix this with an API change.
fixes the mlockall problem.
-rw-r--r-- | sys/arch/i386/include/pmap.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/arch/i386/include/pmap.h b/sys/arch/i386/include/pmap.h index cc806191c88..f134b4d3914 100644 --- a/sys/arch/i386/include/pmap.h +++ b/sys/arch/i386/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.32 2003/05/13 03:49:04 art Exp $ */ +/* $OpenBSD: pmap.h,v 1.33 2003/05/26 16:25:32 art Exp $ */ /* $NetBSD: pmap.h,v 1.44 2000/04/24 17:18:18 thorpej Exp $ */ /* @@ -477,15 +477,12 @@ pmap_protect(pmap, sva, eva, prot) vaddr_t sva, eva; vm_prot_t prot; { - if ((prot & (VM_PROT_WRITE|VM_PROT_EXECUTE)) == - (VM_PROT_WRITE|VM_PROT_EXECUTE)) - return; - - if ((prot & (VM_PROT_READ|VM_PROT_EXECUTE)) == - (VM_PROT_READ|VM_PROT_EXECUTE)) { - pmap_write_protect(pmap, sva, eva, prot); - } else { - pmap_remove(pmap, sva, eva); + if ((prot & VM_PROT_WRITE) == 0) { + if (prot & (VM_PROT_READ|VM_PROT_EXECUTE)) { + pmap_write_protect(pmap, sva, eva, prot); + } else { + pmap_remove(pmap, sva, eva); + } } } |