diff --git a/sys/mips/conf/SWARM b/sys/mips/conf/SWARM index 455e2986f9c9..3189bcbcb9c1 100644 --- a/sys/mips/conf/SWARM +++ b/sys/mips/conf/SWARM @@ -19,13 +19,8 @@ options CFE_CONSOLE options CFE_ENV options ALT_BREAK_TO_DEBUGGER -# Don't build any modules yet. -makeoptions MODULES_OVERRIDE="" -makeoptions TARGET_BIG_ENDIAN=defined makeoptions LDSCRIPT_NAME= ldscript.mips.cfe -makeoptions KERNLOADADDR=0x81000000 - #cpu CPU_MIPS64 #options ISA_MIPS64 #makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64" diff --git a/sys/mips/mips/mem.c b/sys/mips/mips/mem.c index a7f8244385aa..9db282e4206c 100644 --- a/sys/mips/mips/mem.c +++ b/sys/mips/mips/mem.c @@ -120,21 +120,23 @@ memrw(struct cdev *dev, struct uio *uio, int flags) * Make sure that all the pages are currently resident * so that we don't create any zero-fill pages. */ + if (va >= VM_MIN_KERNEL_ADDRESS && + eva <= VM_MAX_KERNEL_ADDRESS) { + for (; va < eva; va += PAGE_SIZE) + if (pmap_extract(kernel_pmap, va) == 0) + return (EFAULT); - for (; va < eva; va += PAGE_SIZE) - if (pmap_extract(kernel_pmap, va) == 0) + prot = (uio->uio_rw == UIO_READ) + ? VM_PROT_READ : VM_PROT_WRITE; + + va = uio->uio_offset; + if (kernacc((void *) va, iov->iov_len, prot) + == FALSE) return (EFAULT); - - prot = (uio->uio_rw == UIO_READ) - ? VM_PROT_READ : VM_PROT_WRITE; + } va = uio->uio_offset; - if (kernacc((void *) va, iov->iov_len, prot) - == FALSE) - return (EFAULT); - error = uiomove((void *)va, iov->iov_len, uio); - continue; } }