diff options
author | 2021-03-09 04:53:40 +0000 | |
---|---|---|
committer | 2021-03-09 04:53:40 +0000 | |
commit | a787a73b306a7b9834ab0efed0df7bf42567548f (patch) | |
tree | 7799d61dae50634f7ae25b0552565391f239a199 | |
parent | Enable ixl(4). (diff) | |
download | wireguard-openbsd-a787a73b306a7b9834ab0efed0df7bf42567548f.tar.xz wireguard-openbsd-a787a73b306a7b9834ab0efed0df7bf42567548f.zip |
ofw_read_mem_regions() can skip calculation of physmem. pmap.c
already calculates _usable_ memory and updates physmem (if it is 0),
whereas ofw_read_mem_regions() was counting usable+unuseable memory.
ie. 4G or more on some machines. powerpc's 32-bit pagetable cannot use memory
beyond 4G phys addr.
(On a 4G machine, physmem64 was calculated as 0, which caused the installer's
auto-diskabel code to place /tmp on the b partition).
ok gkoehler, works for kurt also
-rw-r--r-- | sys/arch/macppc/macppc/ofw_machdep.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/arch/macppc/macppc/ofw_machdep.c b/sys/arch/macppc/macppc/ofw_machdep.c index ef1a31f1362..aed118ce316 100644 --- a/sys/arch/macppc/macppc/ofw_machdep.c +++ b/sys/arch/macppc/macppc/ofw_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_machdep.c,v 1.62 2020/11/02 18:35:38 tobhe Exp $ */ +/* $OpenBSD: ofw_machdep.c,v 1.63 2021/03/09 04:53:40 deraadt Exp $ */ /* $NetBSD: ofw_machdep.c,v 1.1 1996/09/30 16:34:50 ws Exp $ */ /* @@ -137,7 +137,6 @@ ofw_read_mem_regions(int phandle, int address_cells, int size_cells) { int nreg, navail; int i, j; - uint physpages; switch (address_cells) { default: @@ -173,11 +172,9 @@ ofw_read_mem_regions(int phandle, int address_cells, int size_cells) } break; case 2: - physpages = 0; for (i = 0, j = 0; i < nreg; i++) { if (OFmem64[i].size == 0) continue; - physpages += atop(OFmem64[i].size); if (OFmem64[i].start >= 1ULL << 32) continue; OFmem[j].start = OFmem64[i].start; @@ -187,7 +184,6 @@ ofw_read_mem_regions(int phandle, int address_cells, int size_cells) OFmem[j].size = OFmem64[i].size; j++; } - physmem = physpages; break; } } |