Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm Only turn off VM_PROT_WRITE for COW pages; not VM_PR...
details: https://anonhg.NetBSD.org/src/rev/4025e69e896d
branches: trunk
changeset: 467757:4025e69e896d
user: mycroft <mycroft%NetBSD.org@localhost>
date: Sun Mar 28 19:53:49 1999 +0000
description:
Only turn off VM_PROT_WRITE for COW pages; not VM_PROT_EXECUTE.
diffstat:
sys/uvm/uvm_fault.c | 18 +++++++++---------
sys/uvm/uvm_map.c | 6 +++---
2 files changed, 12 insertions(+), 12 deletions(-)
diffs (80 lines):
diff -r e982ef222350 -r 4025e69e896d sys/uvm/uvm_fault.c
--- a/sys/uvm/uvm_fault.c Sun Mar 28 19:41:27 1999 +0000
+++ b/sys/uvm/uvm_fault.c Sun Mar 28 19:53:49 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.23 1999/03/26 21:58:39 mycroft Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.24 1999/03/28 19:53:49 mycroft Exp $ */
/*
*
@@ -546,6 +546,9 @@
* the map locked off during I/O.
*/
+#define MASK(entry) (UVM_ET_ISCOPYONWRITE(entry) ? \
+ ~VM_PROT_WRITE : VM_PROT_ALL)
+
int
uvm_fault(orig_map, vaddr, fault_type, access_type)
vm_map_t orig_map;
@@ -884,8 +887,7 @@
result = uobj->pgops->pgo_get(uobj, ufi.entry->offset +
(startva - ufi.entry->start),
pages, &gotpages, centeridx,
- UVM_ET_ISCOPYONWRITE(ufi.entry) ?
- VM_PROT_READ : access_type,
+ access_type & MASK(ufi.entry),
ufi.entry->advice, PGO_LOCKED);
/*
@@ -946,9 +948,8 @@
uvmexp.fltnomap++;
pmap_enter(ufi.orig_map->pmap, currva,
VM_PAGE_TO_PHYS(pages[lcv]),
- UVM_ET_ISCOPYONWRITE(ufi.entry) ?
- VM_PROT_READ : enter_prot, wired,
- access_type);
+ enter_prot & MASK(ufi.entry),
+ wired, access_type);
/*
* NOTE: page can't be PG_WANTED or PG_RELEASED
@@ -1283,8 +1284,7 @@
result = uobj->pgops->pgo_get(uobj,
(ufi.orig_rvaddr - ufi.entry->start) + ufi.entry->offset,
&uobjpage, &gotpages, 0,
- UVM_ET_ISCOPYONWRITE(ufi.entry) ?
- VM_PROT_READ : access_type,
+ access_type & MASK(ufi.entry),
ufi.entry->advice, 0);
/* locked: uobjpage(if result OK) */
@@ -1415,7 +1415,7 @@
uvmexp.flt_obj++;
if (UVM_ET_ISCOPYONWRITE(ufi.entry))
- enter_prot = enter_prot & ~VM_PROT_WRITE;
+ enter_prot &= ~VM_PROT_WRITE;
pg = uobjpage; /* map in the actual object */
/* assert(uobjpage != PGO_DONTCARE) */
diff -r e982ef222350 -r 4025e69e896d sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Sun Mar 28 19:41:27 1999 +0000
+++ b/sys/uvm/uvm_map.c Sun Mar 28 19:53:49 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_map.c,v 1.35 1999/03/25 18:48:52 mrg Exp $ */
+/* $NetBSD: uvm_map.c,v 1.36 1999/03/28 19:53:50 mycroft Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -1707,8 +1707,8 @@
* => XXXCDC: does not work properly with share maps. rethink.
*/
-#define MASK(entry) ( UVM_ET_ISCOPYONWRITE(entry) ? \
- ~VM_PROT_WRITE : VM_PROT_ALL)
+#define MASK(entry) (UVM_ET_ISCOPYONWRITE(entry) ? \
+ ~VM_PROT_WRITE : VM_PROT_ALL)
#define max(a,b) ((a) > (b) ? (a) : (b))
int
Home |
Main Index |
Thread Index |
Old Index