MCPcopy Create free account
hub / github.com/F-Stack/f-stack / physmem_init_kernel_globals

Function physmem_init_kernel_globals

freebsd/kern/subr_physmem.c:400–416  ·  view source on GitHub ↗

* Process all the regions added earlier into the global avail lists. * * Updates the kernel global 'physmem' with the number of physical pages * available for use (all pages not in any exclusion region). * * Updates the kernel global 'Maxmem' with the page number one greater then the * last page of physical memory in the system. */

Source from the content-addressed store, hash-verified

398 * last page of physical memory in the system.
399 */
400void
401physmem_init_kernel_globals(void)
402{
403 size_t nextidx;
404 u_long hwphyssz;
405
406 hwphyssz = 0;
407 TUNABLE_ULONG_FETCH("hw.physmem", &hwphyssz);
408
409 regions_to_avail(dump_avail, EXFLAG_NODUMP, PHYS_AVAIL_ENTRIES,
410 hwphyssz, NULL, NULL);
411 nextidx = regions_to_avail(phys_avail, EXFLAG_NOALLOC,
412 PHYS_AVAIL_ENTRIES, hwphyssz, &physmem, &realmem);
413 if (nextidx == 0)
414 panic("No memory entries in phys_avail");
415 Maxmem = atop(phys_avail[nextidx - 1]);
416}
417
418#ifdef DDB
419#include <ddb/ddb.h>

Callers 2

initarmFunction · 0.85
initarmFunction · 0.85

Calls 2

regions_to_availFunction · 0.85
panicFunction · 0.70

Tested by

no test coverage detected