diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-04 21:48:08 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-11-04 21:48:08 +0000 |
commit | 3d8e26477d53466e9c6005eb82f67134364b9d3a (patch) | |
tree | 18755a263f25352a3bde8dfd07f44d234c312a78 /sys/uvm | |
parent | df3527a220a7b4406fb3685a06b8b52e7921b3f6 (diff) |
Add an extra flags argument to uvm_io(), to specify whether we want to fix
the protection of the memory mapping we're doing I/O on, or if we want to
leave them as they are. This should only be necessary for breakpoint
insertion in code, so we'll only use it for ptrace requests.
Initially from art@ after discussion with kettenis@ millert@ and I,
tested by many.
Diffstat (limited to 'sys/uvm')
-rw-r--r-- | sys/uvm/uvm_extern.h | 6 | ||||
-rw-r--r-- | sys/uvm/uvm_io.c | 15 |
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h index f9f52056fee..b45f6380974 100644 --- a/sys/uvm/uvm_extern.h +++ b/sys/uvm/uvm_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_extern.h,v 1.58 2005/09/28 00:24:03 pedro Exp $ */ +/* $OpenBSD: uvm_extern.h,v 1.59 2005/11/04 21:48:07 miod Exp $ */ /* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */ /* @@ -491,7 +491,9 @@ void uvm_init(void); /* init the uvm system */ /* uvm_io.c */ -int uvm_io(vm_map_t, struct uio *); +int uvm_io(vm_map_t, struct uio *, int); + +#define UVM_IO_FIXPROT 0x01 /* uvm_km.c */ vaddr_t uvm_km_alloc1(vm_map_t, vsize_t, boolean_t); diff --git a/sys/uvm/uvm_io.c b/sys/uvm/uvm_io.c index 25702be8d4b..f9fb928f4bb 100644 --- a/sys/uvm/uvm_io.c +++ b/sys/uvm/uvm_io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_io.c,v 1.15 2005/05/24 21:11:47 tedu Exp $ */ +/* $OpenBSD: uvm_io.c,v 1.16 2005/11/04 21:48:07 miod Exp $ */ /* $NetBSD: uvm_io.c,v 1.12 2000/06/27 17:29:23 mrg Exp $ */ /* @@ -60,14 +60,12 @@ */ int -uvm_io(map, uio) - vm_map_t map; - struct uio *uio; +uvm_io(vm_map_t map, struct uio *uio, int flags) { vaddr_t baseva, endva, pageoffset, kva; vsize_t chunksz, togo, sz; vm_map_entry_t dead_entries; - int error; + int error, extractflags; /* * step 0: sanity checks and set up for copy loop. start with a @@ -95,6 +93,10 @@ uvm_io(map, uio) chunksz = min(round_page(togo + pageoffset), MAXBSIZE); error = 0; + extractflags = UVM_EXTRACT_QREF | UVM_EXTRACT_CONTIG; + if (flags & UVM_IO_FIXPROT) + extractflags |= UVM_EXTRACT_FIXPROT; + /* * step 1: main loop... while we've got data to move */ @@ -106,8 +108,7 @@ uvm_io(map, uio) */ error = uvm_map_extract(map, baseva, chunksz, kernel_map, &kva, - UVM_EXTRACT_QREF | UVM_EXTRACT_CONTIG | - UVM_EXTRACT_FIXPROT); + extractflags); if (error) { /* retry with a smaller chunk... */ |