summaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-11-04 21:48:08 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-11-04 21:48:08 +0000
commit3d8e26477d53466e9c6005eb82f67134364b9d3a (patch)
tree18755a263f25352a3bde8dfd07f44d234c312a78 /sys/miscfs
parentdf3527a220a7b4406fb3685a06b8b52e7921b3f6 (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/miscfs')
-rw-r--r--sys/miscfs/procfs/procfs_cmdline.c8
-rw-r--r--sys/miscfs/procfs/procfs_mem.c5
2 files changed, 7 insertions, 6 deletions
diff --git a/sys/miscfs/procfs/procfs_cmdline.c b/sys/miscfs/procfs/procfs_cmdline.c
index c23a733045e..191130d5e1f 100644
--- a/sys/miscfs/procfs/procfs_cmdline.c
+++ b/sys/miscfs/procfs/procfs_cmdline.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_cmdline.c,v 1.4 2004/05/05 23:52:09 tedu Exp $ */
+/* $OpenBSD: procfs_cmdline.c,v 1.5 2005/11/04 21:48:07 miod Exp $ */
/* $NetBSD: procfs_cmdline.c,v 1.3 1999/03/13 22:26:48 thorpej Exp $ */
/*
@@ -121,7 +121,7 @@ procfs_docmdline(curp, p, pfs, uio)
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
auio.uio_procp = NULL;
- error = uvm_io(&p->p_vmspace->vm_map, &auio);
+ error = uvm_io(&p->p_vmspace->vm_map, &auio, 0);
if (error)
goto bad;
@@ -137,7 +137,7 @@ procfs_docmdline(curp, p, pfs, uio)
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
auio.uio_procp = NULL;
- error = uvm_io(&p->p_vmspace->vm_map, &auio);
+ error = uvm_io(&p->p_vmspace->vm_map, &auio, 0);
if (error)
goto bad;
@@ -160,7 +160,7 @@ procfs_docmdline(curp, p, pfs, uio)
auio.uio_segflg = UIO_SYSSPACE;
auio.uio_rw = UIO_READ;
auio.uio_procp = NULL;
- error = uvm_io(&p->p_vmspace->vm_map, &auio);
+ error = uvm_io(&p->p_vmspace->vm_map, &auio, 0);
if (error)
goto bad;
diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c
index 95d617083ea..56b73a22c04 100644
--- a/sys/miscfs/procfs/procfs_mem.c
+++ b/sys/miscfs/procfs/procfs_mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_mem.c,v 1.22 2004/05/20 09:20:41 kettenis Exp $ */
+/* $OpenBSD: procfs_mem.c,v 1.23 2005/11/04 21:48:07 miod Exp $ */
/* $NetBSD: procfs_mem.c,v 1.8 1996/02/09 22:40:50 christos Exp $ */
/*
@@ -81,7 +81,8 @@ procfs_domem(curp, p, pfs, uio)
return(EFAULT);
addr = uio->uio_offset;
p->p_vmspace->vm_refcnt++; /* XXX */
- error = uvm_io(&p->p_vmspace->vm_map, uio);
+ error = uvm_io(&p->p_vmspace->vm_map, uio,
+ uio->uio_rw == UIO_WRITE ? UVM_IO_FIXPROT : 0);
uvmspace_free(p->p_vmspace);
if (error == 0 && uio->uio_rw == UIO_WRITE)