Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/aim/mmu_radix.c
Show First 20 Lines • Show All 4,242 Lines • ▼ Show 20 Lines | _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp) | ||||
if (ptepindex >= (NUPDE + NUPDPE)) { | if (ptepindex >= (NUPDE + NUPDPE)) { | ||||
pml1_entry_t *l1e; | pml1_entry_t *l1e; | ||||
vm_pindex_t pml1index; | vm_pindex_t pml1index; | ||||
/* Wire up a new PDPE page */ | /* Wire up a new PDPE page */ | ||||
pml1index = ptepindex - (NUPDE + NUPDPE); | pml1index = ptepindex - (NUPDE + NUPDPE); | ||||
l1e = &pmap->pm_pml1[pml1index]; | l1e = &pmap->pm_pml1[pml1index]; | ||||
KASSERT((be64toh(*l1e) & PG_V) == 0, | |||||
("%s: L1 entry %#lx is valid", __func__, *l1e)); | |||||
pde_store(l1e, VM_PAGE_TO_PHYS(m)); | pde_store(l1e, VM_PAGE_TO_PHYS(m)); | ||||
} else if (ptepindex >= NUPDE) { | } else if (ptepindex >= NUPDE) { | ||||
vm_pindex_t pml1index; | vm_pindex_t pml1index; | ||||
vm_pindex_t pdpindex; | vm_pindex_t pdpindex; | ||||
pml1_entry_t *l1e; | pml1_entry_t *l1e; | ||||
pml2_entry_t *l2e; | pml2_entry_t *l2e; | ||||
/* Wire up a new l2e page */ | /* Wire up a new l2e page */ | ||||
pdpindex = ptepindex - NUPDE; | pdpindex = ptepindex - NUPDE; | ||||
Show All 12 Lines | if ((be64toh(*l1e) & PG_V) == 0) { | ||||
/* Add reference to l2e page */ | /* Add reference to l2e page */ | ||||
pdppg = PHYS_TO_VM_PAGE(be64toh(*l1e) & PG_FRAME); | pdppg = PHYS_TO_VM_PAGE(be64toh(*l1e) & PG_FRAME); | ||||
pdppg->ref_count++; | pdppg->ref_count++; | ||||
} | } | ||||
l2e = (pml2_entry_t *)PHYS_TO_DMAP(be64toh(*l1e) & PG_FRAME); | l2e = (pml2_entry_t *)PHYS_TO_DMAP(be64toh(*l1e) & PG_FRAME); | ||||
/* Now find the pdp page */ | /* Now find the pdp page */ | ||||
l2e = &l2e[pdpindex & RPTE_MASK]; | l2e = &l2e[pdpindex & RPTE_MASK]; | ||||
KASSERT((be64toh(*l2e) & PG_V) == 0, | |||||
("%s: L2 entry %#lx is valid", __func__, *l2e)); | |||||
pde_store(l2e, VM_PAGE_TO_PHYS(m)); | pde_store(l2e, VM_PAGE_TO_PHYS(m)); | ||||
} else { | } else { | ||||
vm_pindex_t pml1index; | vm_pindex_t pml1index; | ||||
vm_pindex_t pdpindex; | vm_pindex_t pdpindex; | ||||
pml1_entry_t *l1e; | pml1_entry_t *l1e; | ||||
pml2_entry_t *l2e; | pml2_entry_t *l2e; | ||||
pml3_entry_t *l3e; | pml3_entry_t *l3e; | ||||
/* Wire up a new PTE page */ | /* Wire up a new PTE page */ | ||||
Show All 28 Lines | if ((be64toh(*l1e) & PG_V) == 0) { | ||||
pdpg = PHYS_TO_VM_PAGE(be64toh(*l2e) & PG_FRAME); | pdpg = PHYS_TO_VM_PAGE(be64toh(*l2e) & PG_FRAME); | ||||
pdpg->ref_count++; | pdpg->ref_count++; | ||||
} | } | ||||
} | } | ||||
l3e = (pml3_entry_t *)PHYS_TO_DMAP(be64toh(*l2e) & PG_FRAME); | l3e = (pml3_entry_t *)PHYS_TO_DMAP(be64toh(*l2e) & PG_FRAME); | ||||
/* Now we know where the page directory page is */ | /* Now we know where the page directory page is */ | ||||
l3e = &l3e[ptepindex & RPTE_MASK]; | l3e = &l3e[ptepindex & RPTE_MASK]; | ||||
KASSERT((be64toh(*l3e) & PG_V) == 0, | |||||
("%s: L3 entry %#lx is valid", __func__, *l3e)); | |||||
pde_store(l3e, VM_PAGE_TO_PHYS(m)); | pde_store(l3e, VM_PAGE_TO_PHYS(m)); | ||||
} | } | ||||
pmap_resident_count_inc(pmap, 1); | pmap_resident_count_inc(pmap, 1); | ||||
return (m); | return (m); | ||||
} | } | ||||
static vm_page_t | static vm_page_t | ||||
pmap_allocl3e(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) | pmap_allocl3e(pmap_t pmap, vm_offset_t va, struct rwlock **lockp) | ||||
▲ Show 20 Lines • Show All 2,108 Lines • Show Last 20 Lines |