Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/amd64/mp_machdep.c
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | mp_bootaddress(vm_paddr_t *physmap, unsigned int *physmap_idx) | ||||
unsigned int i; | unsigned int i; | ||||
bool allocated; | bool allocated; | ||||
alloc_ap_trampoline(physmap, physmap_idx); | alloc_ap_trampoline(physmap, physmap_idx); | ||||
allocated = false; | allocated = false; | ||||
for (i = *physmap_idx; i <= *physmap_idx; i -= 2) { | for (i = *physmap_idx; i <= *physmap_idx; i -= 2) { | ||||
/* | /* | ||||
* Find a memory region big enough below the 4GB boundary to | * Find a memory region big enough below the 4GB | ||||
* store the initial page tables. Note that it needs to be | * boundary to store the initial page tables. Region | ||||
* aligned to a page boundary. | * must be mapped by the direct map. | ||||
* | |||||
* Note that it needs to be aligned to a page | |||||
* boundary. | |||||
*/ | */ | ||||
if (physmap[i] >= GiB(4) || | if (physmap[i] >= GiB(4) || physmap[i + 1] - | ||||
(physmap[i + 1] - round_page(physmap[i])) < (PAGE_SIZE * 3)) | round_page(physmap[i]) < PAGE_SIZE * 3 || | ||||
physmap[i + 1] > Maxmem) | |||||
continue; | continue; | ||||
allocated = true; | allocated = true; | ||||
mptramp_pagetables = round_page(physmap[i]); | mptramp_pagetables = round_page(physmap[i]); | ||||
physmap[i] = round_page(physmap[i]) + (PAGE_SIZE * 3); | physmap[i] = round_page(physmap[i]) + (PAGE_SIZE * 3); | ||||
if (physmap[i] == physmap[i + 1] && *physmap_idx != 0) { | if (physmap[i] == physmap[i + 1] && *physmap_idx != 0) { | ||||
memmove(&physmap[i], &physmap[i + 2], | memmove(&physmap[i], &physmap[i + 2], | ||||
sizeof(*physmap) * (*physmap_idx - i + 2)); | sizeof(*physmap) * (*physmap_idx - i + 2)); | ||||
▲ Show 20 Lines • Show All 542 Lines • Show Last 20 Lines |