Correctly calculate size of memory to be mapped when copying. Removal
of the 256Mb 1:1 BAT mapping exposed this as copying into memory that hadn't been claimed from OpenFirmware. compiled-tested on: panther (sparc64). Code built, but not used, on sparc64
This commit is contained in:
parent
4bb04ec4eb
commit
ff6e6584fc
@ -47,9 +47,11 @@ ofw_copyin(const void *src, vm_offset_t dest, const size_t len)
|
||||
{
|
||||
void *destp, *addr;
|
||||
size_t dlen;
|
||||
size_t resid;
|
||||
|
||||
destp = (void *)(dest & ~PAGE_MASK);
|
||||
dlen = roundup(len, PAGE_SIZE);
|
||||
resid = dest & PAGE_MASK;
|
||||
dlen = roundup(len + resid, PAGE_SIZE);
|
||||
|
||||
if (OF_call_method("claim", memory, 3, 1, destp, dlen, 0, &addr)
|
||||
== -1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user