Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/amd64/machdep.c
Show First 20 Lines • Show All 1,242 Lines • ▼ Show 20 Lines | getmemsize(caddr_t kmdp, u_int64_t first) | ||||
if (basemem == 0 || basemem > 640) { | if (basemem == 0 || basemem > 640) { | ||||
if (bootverbose) | if (bootverbose) | ||||
printf( | printf( | ||||
"Memory map doesn't contain a basemem segment, faking it"); | "Memory map doesn't contain a basemem segment, faking it"); | ||||
basemem = 640; | basemem = 640; | ||||
} | } | ||||
/* | /* | ||||
* Make hole for "AP -> long mode" bootstrap code. The | |||||
* mp_bootaddress vector is only available when the kernel | |||||
* is configured to support APs and APs for the system start | |||||
* in real mode mode (e.g. SMP bare metal). | |||||
*/ | |||||
if (init_ops.mp_bootaddress) | |||||
init_ops.mp_bootaddress(physmap, &physmap_idx); | |||||
/* | |||||
* Maxmem isn't the "maximum memory", it's one larger than the | * Maxmem isn't the "maximum memory", it's one larger than the | ||||
* highest page of the physical address space. It should be | * highest page of the physical address space. It should be | ||||
* called something like "Maxphyspage". We may adjust this | * called something like "Maxphyspage". We may adjust this | ||||
* based on ``hw.physmem'' and the results of the memory test. | * based on ``hw.physmem'' and the results of the memory test. | ||||
*/ | */ | ||||
Maxmem = atop(physmap[physmap_idx + 1]); | Maxmem = atop(physmap[physmap_idx + 1]); | ||||
#ifdef MAXMEM | #ifdef MAXMEM | ||||
Show All 20 Lines | #endif | ||||
* in the system. | * in the system. | ||||
*/ | */ | ||||
if (Maxmem > atop(physmap[physmap_idx + 1])) | if (Maxmem > atop(physmap[physmap_idx + 1])) | ||||
Maxmem = atop(physmap[physmap_idx + 1]); | Maxmem = atop(physmap[physmap_idx + 1]); | ||||
if (atop(physmap[physmap_idx + 1]) != Maxmem && | if (atop(physmap[physmap_idx + 1]) != Maxmem && | ||||
(boothowto & RB_VERBOSE)) | (boothowto & RB_VERBOSE)) | ||||
printf("Physical memory use set to %ldK\n", Maxmem * 4); | printf("Physical memory use set to %ldK\n", Maxmem * 4); | ||||
/* | |||||
* Make hole for "AP -> long mode" bootstrap code. The | |||||
* mp_bootaddress vector is only available when the kernel | |||||
* is configured to support APs and APs for the system start | |||||
* in real mode mode (e.g. SMP bare metal). | |||||
*/ | |||||
if (init_ops.mp_bootaddress) | |||||
init_ops.mp_bootaddress(physmap, &physmap_idx); | |||||
/* call pmap initialization to make new kernel address space */ | /* call pmap initialization to make new kernel address space */ | ||||
pmap_bootstrap(&first); | pmap_bootstrap(&first); | ||||
/* | /* | ||||
* Size up each available chunk of physical memory. | * Size up each available chunk of physical memory. | ||||
* | * | ||||
* XXX Some BIOSes corrupt low 64KB between suspend and resume. | * XXX Some BIOSes corrupt low 64KB between suspend and resume. | ||||
▲ Show 20 Lines • Show All 1,344 Lines • Show Last 20 Lines |