summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-02-08 13:17:41 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-02-08 13:17:41 +0000
commit9d14da4399d6a287057683834776c4cb66ffd8ef (patch)
tree338bdf5b50a0c221c25a397bf216e57225bac688 /sys/arch/powerpc
parent4b706fb65a905593a0bb5a3ddbf29a707bc401cb (diff)
Some (if not all) G5 systems use a different layout for the physical memory
information (property `reg' of the `/memory' node). Fortunately the available physical memory information still uses the same format, so this only affects the computation of physmem. Detect this case and parse the information correctly, converting to the format expected by pmap, ignoring physical memory beyond 4GB. Compute physmem from all the physical memory information, even memory not usable by the kernel. Let pmap not recompute physmem in pmap_bootstrap() if physmem is != 0 upon entry. This should allow G5 systems fitted with more than 2GB of physical memory to report the correct amount of memory, even though the kernel will only use the lower 2GB. Prompted by a dmesg@ submission by Greg Marsh, owner of a 3.5GB G5 help and tweaks kettenis@, ok mpi@
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r--sys/arch/powerpc/powerpc/pmap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c
index 896b749e4cc..e6a84ac7bff 100644
--- a/sys/arch/powerpc/powerpc/pmap.c
+++ b/sys/arch/powerpc/powerpc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.122 2013/12/29 19:09:21 brad Exp $ */
+/* $OpenBSD: pmap.c,v 1.123 2014/02/08 13:17:40 miod Exp $ */
/*
* Copyright (c) 2001, 2002, 2007 Dale Rahn.
@@ -1396,18 +1396,22 @@ void
pmap_avail_setup(void)
{
struct mem_region *mp;
+ int pmap_physmem;
(fw->mem_regions) (&pmap_mem, &pmap_avail);
pmap_cnt_avail = 0;
- physmem = 0;
+ pmap_physmem = 0;
ndumpmem = 0;
for (mp = pmap_mem; mp->size !=0; mp++, ndumpmem++) {
- physmem += atop(mp->size);
+ pmap_physmem += atop(mp->size);
dumpmem[ndumpmem].start = atop(mp->start);
dumpmem[ndumpmem].end = atop(mp->start + mp->size);
}
+ if (physmem == 0)
+ physmem = pmap_physmem;
+
for (mp = pmap_avail; mp->size !=0 ; mp++) {
if (physmaxaddr < mp->start + mp->size)
physmaxaddr = mp->start + mp->size;