o) Back out my previous change to SWARM; some of it was to address an issue
that turned out to be unrelated, and the rest was, as pointed out by Neel, just wrong-headed. o) Tweak mem.c to fix use of /dev/kmem for direct-mapped addresses.
This commit is contained in:
parent
5605409291
commit
175b654e30
@ -19,13 +19,8 @@ options CFE_CONSOLE
|
|||||||
options CFE_ENV
|
options CFE_ENV
|
||||||
options ALT_BREAK_TO_DEBUGGER
|
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 LDSCRIPT_NAME= ldscript.mips.cfe
|
||||||
|
|
||||||
makeoptions KERNLOADADDR=0x81000000
|
|
||||||
|
|
||||||
#cpu CPU_MIPS64
|
#cpu CPU_MIPS64
|
||||||
#options ISA_MIPS64
|
#options ISA_MIPS64
|
||||||
#makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64"
|
#makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64"
|
||||||
|
@ -120,21 +120,23 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
|
|||||||
* Make sure that all the pages are currently resident
|
* Make sure that all the pages are currently resident
|
||||||
* so that we don't create any zero-fill pages.
|
* 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)
|
prot = (uio->uio_rw == UIO_READ)
|
||||||
if (pmap_extract(kernel_pmap, va) == 0)
|
? VM_PROT_READ : VM_PROT_WRITE;
|
||||||
|
|
||||||
|
va = uio->uio_offset;
|
||||||
|
if (kernacc((void *) va, iov->iov_len, prot)
|
||||||
|
== FALSE)
|
||||||
return (EFAULT);
|
return (EFAULT);
|
||||||
|
}
|
||||||
prot = (uio->uio_rw == UIO_READ)
|
|
||||||
? VM_PROT_READ : VM_PROT_WRITE;
|
|
||||||
|
|
||||||
va = uio->uio_offset;
|
va = uio->uio_offset;
|
||||||
if (kernacc((void *) va, iov->iov_len, prot)
|
|
||||||
== FALSE)
|
|
||||||
return (EFAULT);
|
|
||||||
|
|
||||||
error = uiomove((void *)va, iov->iov_len, uio);
|
error = uiomove((void *)va, iov->iov_len, uio);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user