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
-/* $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 $ */
/*
{
int nreg, navail;
int i, j;
- uint physpages;
switch (address_cells) {
default:
}
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;
OFmem[j].size = OFmem64[i].size;
j++;
}
- physmem = physpages;
break;
}
}