Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/vm_page.c
Show First 20 Lines • Show All 473 Lines • ▼ Show 20 Lines | vm_page_startup(vm_offset_t vaddr) | ||||
TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); | TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); | ||||
new_end = end - (boot_pages * UMA_SLAB_SIZE); | new_end = end - (boot_pages * UMA_SLAB_SIZE); | ||||
new_end = trunc_page(new_end); | new_end = trunc_page(new_end); | ||||
mapped = pmap_map(&vaddr, new_end, end, | mapped = pmap_map(&vaddr, new_end, end, | ||||
VM_PROT_READ | VM_PROT_WRITE); | VM_PROT_READ | VM_PROT_WRITE); | ||||
bzero((void *)mapped, end - new_end); | bzero((void *)mapped, end - new_end); | ||||
uma_startup((void *)mapped, boot_pages); | uma_startup((void *)mapped, boot_pages); | ||||
#if defined(__amd64__) || defined(__i386__) || defined(__arm__) || \ | #if defined(__aarch64__) || defined(__amd64__) || defined(__arm__) || \ | ||||
defined(__mips__) | defined(__i386__) || defined(__mips__) | ||||
/* | /* | ||||
* Allocate a bitmap to indicate that a random physical page | * Allocate a bitmap to indicate that a random physical page | ||||
* needs to be included in a minidump. | * needs to be included in a minidump. | ||||
* | * | ||||
* The amd64 port needs this to indicate which direct map pages | * The amd64 port needs this to indicate which direct map pages | ||||
* need to be dumped, via calls to dump_add_page()/dump_drop_page(). | * need to be dumped, via calls to dump_add_page()/dump_drop_page(). | ||||
* | * | ||||
* However, i386 still needs this workspace internally within the | * However, i386 still needs this workspace internally within the | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | #endif | ||||
vm_page_array = (vm_page_t) mapped; | vm_page_array = (vm_page_t) mapped; | ||||
#if VM_NRESERVLEVEL > 0 | #if VM_NRESERVLEVEL > 0 | ||||
/* | /* | ||||
* Allocate memory for the reservation management system's data | * Allocate memory for the reservation management system's data | ||||
* structures. | * structures. | ||||
*/ | */ | ||||
new_end = vm_reserv_startup(&vaddr, new_end, high_water); | new_end = vm_reserv_startup(&vaddr, new_end, high_water); | ||||
#endif | #endif | ||||
#if defined(__amd64__) || defined(__mips__) | #if defined(__aarch64__) || defined(__amd64__) || defined(__mips__) | ||||
/* | /* | ||||
* pmap_map on amd64 and mips can come out of the direct-map, not kvm | * pmap_map on arm64, amd64, and mips can come out of the direct-map, | ||||
* like i386, so the pages must be tracked for a crashdump to include | * not kvm like i386, so the pages must be tracked for a crashdump to | ||||
* this data. This includes the vm_page_array and the early UMA | * include this data. This includes the vm_page_array and the early | ||||
* bootstrap pages. | * UMA bootstrap pages. | ||||
*/ | */ | ||||
for (pa = new_end; pa < phys_avail[biggestone + 1]; pa += PAGE_SIZE) | for (pa = new_end; pa < phys_avail[biggestone + 1]; pa += PAGE_SIZE) | ||||
dump_add_page(pa); | dump_add_page(pa); | ||||
#endif | #endif | ||||
phys_avail[biggestone + 1] = new_end; | phys_avail[biggestone + 1] = new_end; | ||||
/* | /* | ||||
* Add physical memory segments corresponding to the available | * Add physical memory segments corresponding to the available | ||||
▲ Show 20 Lines • Show All 2,793 Lines • Show Last 20 Lines |