summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-09-07 15:03:02 +0000
committerjhb <jhb@FreeBSD.org>2006-09-07 15:03:02 +0000
commit140b39e46d111d4f737868a69dbaa66515960a9f (patch)
treed6763fa2499cb19f48eb4f551cbf723279aa8a9d
parent0d416557b83f1cab7866408d2a3356d74f9e2f3c (diff)
downloadFreeBSD-src-140b39e46d111d4f737868a69dbaa66515960a9f.zip
FreeBSD-src-140b39e46d111d4f737868a69dbaa66515960a9f.tar.gz
Use a single constant to define the sizes of the physmap[], phys_avail[],
and dump_avail[] arrays so they are in sync (previously it was possible to store more entries in the physmap[] then we could store in phys_avail[], which was pointless). While I'm here, bump up the length of these tables to hold 30 entries on amd64 and 16 on i386. This allows machines with fairly fragmented memory maps to boot ok (at least one machine would not boot FreeBSD/i386 but would boot FreeBSD/amd64 because amd64 allowed for more fragments). MFC after: 3 days
-rw-r--r--sys/amd64/amd64/machdep.c8
-rw-r--r--sys/i386/i386/machdep.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index ff23678..544b9fb 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -160,8 +160,10 @@ int cold = 1;
long Maxmem = 0;
long realmem = 0;
-vm_paddr_t phys_avail[20];
-vm_paddr_t dump_avail[20];
+#define PHYSMAP_SIZE (2 * 30)
+
+vm_paddr_t phys_avail[PHYSMAP_SIZE + 2];
+vm_paddr_t dump_avail[PHYSMAP_SIZE + 2];
/* must be 2 less so 0 0 can signal end of chunks */
#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(phys_avail[0])) - 2)
@@ -832,8 +834,6 @@ isa_irq_pending(void)
}
#endif
-#define PHYSMAP_SIZE (2 * 20)
-
u_int basemem;
/*
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 8f2c54f..32b6d78 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -188,8 +188,10 @@ static void freebsd4_sendsig(sig_t catcher, ksiginfo_t *, sigset_t *mask);
long Maxmem = 0;
long realmem = 0;
-vm_paddr_t phys_avail[10];
-vm_paddr_t dump_avail[10];
+#define PHYSMAP_SIZE (2 * 16)
+
+vm_paddr_t phys_avail[PHYSMAP_SIZE + 2];
+vm_paddr_t dump_avail[PHYSMAP_SIZE + 2];
/* must be 2 less so 0 0 can signal end of chunks */
#define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(phys_avail[0])) - 2)
@@ -1614,8 +1616,6 @@ sdtossd(sd, ssd)
ssd->ssd_gran = sd->sd_gran;
}
-#define PHYSMAP_SIZE (2 * 8)
-
/*
* Populate the (physmap) array with base/bound pairs describing the
* available physical memory in the system, then test this memory and
OpenPOWER on IntegriCloud