Commit 3a327967 authored by Andrew Turner's avatar Andrew Turner
Browse files

Pass the array length into regions_to_avail.

On arm64 we will need to get the phys_avail array from before the kernel
is excluded to create teh DMAP region. In preperation for this pass in the
array length into regions_to_avail.
parent 82a4284d
......@@ -168,8 +168,8 @@ arm_physmem_print_tables(void)
* Returns the number of pages of non-excluded memory added to the avail list.
*/
static size_t
regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail,
long *prealmem)
regions_to_avail(vm_paddr_t *avail, uint32_t exflags, size_t maxavail,
long *pavail, long *prealmem)
{
size_t acnt, exi, hwi;
uint64_t end, start, xend, xstart;
......@@ -258,7 +258,7 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, long *pavail,
}
availmem += pm_btop((vm_offset_t)(end - start));
}
if (acnt >= MAX_AVAIL_ENTRIES)
if (acnt >= maxavail)
panic("Not enough space in the dump/phys_avail arrays");
}
......@@ -389,9 +389,10 @@ arm_physmem_init_kernel_globals(void)
{
size_t nextidx;
regions_to_avail(dump_avail, EXFLAG_NODUMP, NULL, NULL);
nextidx = regions_to_avail(phys_avail, EXFLAG_NOALLOC, &physmem,
&realmem);
regions_to_avail(dump_avail, EXFLAG_NODUMP, MAX_AVAIL_ENTRIES, NULL,
NULL);
nextidx = regions_to_avail(phys_avail, EXFLAG_NOALLOC,
MAX_AVAIL_ENTRIES, &physmem, &realmem);
if (nextidx == 0)
panic("No memory entries in phys_avail");
Maxmem = atop(phys_avail[nextidx - 1]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment