From 3fcb99ebca01fead53557ba5bc81cde5a67564a0 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Mon, 26 May 2003 16:25:33 +0000 Subject: 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. --- sys/arch/i386/include/pmap.h | 17 +++++++---------- 1 file 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); + } } } -- cgit v1.2.3