* 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. */
| 398 | * last page of physical memory in the system. |
| 399 | */ |
| 400 | void |
| 401 | physmem_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> |
no test coverage detected