Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/pmap.c
Show First 20 Lines • Show All 1,345 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct vm_phys_seg *seg, *next_seg; | struct vm_phys_seg *seg, *next_seg; | ||||
struct pmap_large_md_page *pvd; | struct pmap_large_md_page *pvd; | ||||
vm_size_t s; | vm_size_t s; | ||||
long start, end, highest, pv_npg; | long start, end, highest, pv_npg; | ||||
int domain, i, j, pages; | int domain, i, j, pages; | ||||
/* | /* | ||||
* We strongly depend on the size being a power of two, so the assert | * We depend on the size being evenly divisible into a page so | ||||
* is overzealous. However, should the struct be resized to a | * that the pv_table array can be indexed directly while | ||||
* different power of two, the code below needs to be revisited. | * safely spanning multiple pages from different domains. | ||||
*/ | */ | ||||
CTASSERT((sizeof(*pvd) == 64)); | CTASSERT(PAGE_SIZE % sizeof(*pvd) == 0); | ||||
/* | /* | ||||
* Calculate the size of the array. | * Calculate the size of the array. | ||||
*/ | */ | ||||
pv_npg = 0; | pv_npg = 0; | ||||
for (i = 0; i < vm_phys_nsegs; i++) { | for (i = 0; i < vm_phys_nsegs; i++) { | ||||
seg = &vm_phys_segs[i]; | seg = &vm_phys_segs[i]; | ||||
pv_npg += pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) - | pv_npg += pmap_l2_pindex(roundup2(seg->end, L2_SIZE)) - | ||||
▲ Show 20 Lines • Show All 6,385 Lines • Show Last 20 Lines |