Machine independent part of fix for PR 6152 (gdb doesn't work on machines

with UVM and seperate I&D-Cache). Mostly by Michael Hitch, but pass struct
proc * instead of the pmap. Reason: said machine will need a method to do
the syncing operation for "curproc", too; this way more code can be shared.
This commit is contained in:
is 1999-02-25 21:54:53 +00:00
parent 7255b47042
commit fde637530e
2 changed files with 17 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.25 1999/02/25 19:51:22 is Exp $ */
/* $NetBSD: pmap.h,v 1.26 1999/02/25 21:54:53 is Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@ -138,6 +138,7 @@ struct pmap kernel_pmap_store;
vm_offset_t pmap_map __P((vm_offset_t, vm_offset_t, vm_offset_t, int));
void pmap_procwr __P((struct proc *, vm_offset_t, u_long));
#define PMAP_NEED_PROCWR
#endif /* _KERNEL */

View File

@ -1,4 +1,4 @@
/* $NetBSD: procfs_mem.c,v 1.19 1998/08/13 02:10:58 eeh Exp $ */
/* $NetBSD: procfs_mem.c,v 1.20 1999/02/25 21:54:53 is Exp $ */
/*
* Copyright (c) 1993 Jan-Simon Pendry
@ -222,9 +222,16 @@ procfs_domem(curp, p, pfs, uio)
{
int error;
if (uio->uio_resid == 0)
size_t len;
vaddr_t addr;
len = uio->uio_resid;
if (len == 0)
return (0);
addr = uio->uio_offset;
if ((error = procfs_checkioperm(curp, p)) != 0)
return (error);
@ -237,6 +244,12 @@ procfs_domem(curp, p, pfs, uio)
error = uvm_io(&p->p_vmspace->vm_map, uio);
PRELE(p);
uvmspace_free(p->p_vmspace);
#ifdef PMAP_NEED_PROCWR
if (uio->uio_rw == UIO_WRITE)
pmap_procwr(p, addr, len);
#endif
#else
PHOLD(p);
error = procfs_rwmem(p, uio);