summaryrefslogtreecommitdiffstats
path: root/sys/boot/ofw
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2004-07-08 06:06:56 +0000
committergrehan <grehan@FreeBSD.org>2004-07-08 06:06:56 +0000
commit9063ace8b46b3a85ac81f553245ed2fb2a138ed0 (patch)
treed792e31cba906bbcc99a5aa841dbeeae557c031c /sys/boot/ofw
parentebf9bdd5488d9d612035dad8c7ac0544c74882fb (diff)
downloadFreeBSD-src-9063ace8b46b3a85ac81f553245ed2fb2a138ed0.zip
FreeBSD-src-9063ace8b46b3a85ac81f553245ed2fb2a138ed0.tar.gz
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
Diffstat (limited to 'sys/boot/ofw')
-rw-r--r--sys/boot/ofw/libofw/ofw_copy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/boot/ofw/libofw/ofw_copy.c b/sys/boot/ofw/libofw/ofw_copy.c
index 78f3cee..ba8c91f 100644
--- a/sys/boot/ofw/libofw/ofw_copy.c
+++ b/sys/boot/ofw/libofw/ofw_copy.c
@@ -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) {
OpenPOWER on IntegriCloud