diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-08-10 17:06:07 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 2004-08-10 17:06:07 +0000 |
commit | 24901e8f49b0c2101deb02e438766a5a35da808f (patch) | |
tree | d0f3d63ded9d83082d4db6a7803d273ebed286e4 /sys/arch/mips64 | |
parent | 02434494e5dce999aa66431f81ad4e467c2de522 (diff) |
make kvm happy again!
Diffstat (limited to 'sys/arch/mips64')
-rw-r--r-- | sys/arch/mips64/mips64/mem.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/arch/mips64/mips64/mem.c b/sys/arch/mips64/mips64/mem.c index 7508e4b524b..9486dab1e62 100644 --- a/sys/arch/mips64/mips64/mem.c +++ b/sys/arch/mips64/mips64/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.2 2004/08/09 14:57:26 pefo Exp $ */ +/* $OpenBSD: mem.c,v 1.3 2004/08/10 17:06:06 pefo Exp $ */ /* $NetBSD: mem.c,v 1.6 1995/04/10 11:55:03 mycroft Exp $ */ /* @@ -152,14 +152,15 @@ mmrw(dev, uio, flags) case 1: v = uio->uio_offset; c = min(iov->iov_len, MAXPHYS); - if (v < KSEG0_BASE) - return (EFAULT); - if (!uvm_kernacc((caddr_t)v, c, - uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) - return (EFAULT); + if ((v > KSEG0_BASE && v + c <= KSEG0_BASE + ctob(physmem)) || + uvm_kernacc((caddr_t)v, c, + uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) { - error = uiomove((caddr_t)v, c, uio); - continue; + error = uiomove((caddr_t)v, c, uio); + continue; + } else { + return (EFAULT); + } /* minor device 2 is EOF/RATHOLE */ case 2: |