svn commit: r334045 - head/sys/arm/arm
Andrew Turner
andrew at FreeBSD.org
Tue May 22 14:26:59 UTC 2018
Author: andrew
Date: Tue May 22 14:26:58 2018
New Revision: 334045
URL: https://svnweb.freebsd.org/changeset/base/334045
Log:
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.
Modified:
head/sys/arm/arm/physmem.c
Modified: head/sys/arm/arm/physmem.c
==============================================================================
--- head/sys/arm/arm/physmem.c Tue May 22 14:25:40 2018 (r334044)
+++ head/sys/arm/arm/physmem.c Tue May 22 14:26:58 2018 (r334045)
@@ -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,
}
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]);
More information about the svn-src-head
mailing list