summaryrefslogtreecommitdiff
path: root/sys/miscfs
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2004-05-20 09:20:43 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2004-05-20 09:20:43 +0000
commitfa548ed2239322fed4b99e17ca368c836285328c (patch)
tree55aab0ddc31aa2e7f0a93ce13b8a59cf28fccc84 /sys/miscfs
parentbb1fe1b9b98659e5bb936357bf26eda5391543bf (diff)
Properly flush instruction cache for ptrace(PT_WRTIE_{DI}, ...) on powerpc
and m68k. ok drahn@, millert@
Diffstat (limited to 'sys/miscfs')
-rw-r--r--sys/miscfs/procfs/procfs_mem.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/miscfs/procfs/procfs_mem.c b/sys/miscfs/procfs/procfs_mem.c
index 0e6cd9bede8..95d617083ea 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.21 2004/05/05 23:52:10 tedu Exp $ */
+/* $OpenBSD: procfs_mem.c,v 1.22 2004/05/20 09:20:41 kettenis Exp $ */
/* $NetBSD: procfs_mem.c,v 1.8 1996/02/09 22:40:50 christos Exp $ */
/*
@@ -66,19 +66,27 @@ procfs_domem(curp, p, pfs, uio)
struct uio *uio;
{
int error;
+ vaddr_t addr;
+ vsize_t len;
- if (uio->uio_resid == 0)
+ len = uio->uio_resid;
+ if (len == 0)
return (0);
if ((error = procfs_checkioperm(curp, p)) != 0)
return (error);
+
/* XXXCDC: how should locking work here? */
if ((p->p_flag & P_WEXIT) || (p->p_vmspace->vm_refcnt < 1))
return(EFAULT);
+ addr = uio->uio_offset;
p->p_vmspace->vm_refcnt++; /* XXX */
error = uvm_io(&p->p_vmspace->vm_map, uio);
uvmspace_free(p->p_vmspace);
+ if (error == 0 && uio->uio_rw == UIO_WRITE)
+ pmap_proc_iflush(p, addr, len);
+
return error;
}