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
This commit is contained in:
parent
0d416557b8
commit
140b39e46d
@ -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;
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user