summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2015-01-31 18:39:32 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2015-01-31 18:39:32 +0000
commit4edec35371babbbdc658b292cec37d4c06752712 (patch)
treeec1ed91b6a21d5c46c75c641e4ccb5df3af94b9f
parent7eac6b3e694ade2165f48d817540a1ad166fba80 (diff)
downloadFreeBSD-src-4edec35371babbbdc658b292cec37d4c06752712.zip
FreeBSD-src-4edec35371babbbdc658b292cec37d4c06752712.tar.gz
Correctness improvements for removing FDT excluded memory areas.
-rw-r--r--sys/powerpc/ofw/ofw_machdep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/powerpc/ofw/ofw_machdep.c b/sys/powerpc/ofw/ofw_machdep.c
index 50f9d9e..05af094 100644
--- a/sys/powerpc/ofw/ofw_machdep.c
+++ b/sys/powerpc/ofw/ofw_machdep.c
@@ -259,16 +259,14 @@ excise_fdt_reserved(struct mem_region *avail, int asz)
if (fdtmap[j].address + fdtmap[j].size <
avail[i].mr_start + avail[i].mr_size) {
avail[asz].mr_start =
- roundup2(fdtmap[j].address +
- fdtmap[j].size, PAGE_SIZE);
+ fdtmap[j].address + fdtmap[j].size;
avail[asz].mr_size = avail[i].mr_start +
avail[i].mr_size -
avail[asz].mr_start;
asz++;
}
- avail[i].mr_size =
- rounddown2(fdtmap[j].address, PAGE_MASK) -
+ avail[i].mr_size = fdtmap[j].address -
avail[i].mr_start;
}
@@ -282,8 +280,10 @@ excise_fdt_reserved(struct mem_region *avail, int asz)
avail[i].mr_start && fdtmap[j].address +
fdtmap[j].size < avail[i].mr_start +
avail[i].mr_size) {
+ avail[i].mr_size += avail[i].mr_start;
avail[i].mr_start =
- roundup2(fdtmap[j].address + fdtmap[j].size, PAGE_MASK);
+ fdtmap[j].address + fdtmap[j].size;
+ avail[i].mr_size -= avail[i].mr_start;
}
}
}
OpenPOWER on IntegriCloud