Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/pmap.c
Show First 20 Lines • Show All 5,240 Lines • ▼ Show 20 Lines | |||||
* pmap_is_prefaultable: | * pmap_is_prefaultable: | ||||
* | * | ||||
* Return whether or not the specified virtual address is eligible | * Return whether or not the specified virtual address is eligible | ||||
* for prefault. | * for prefault. | ||||
*/ | */ | ||||
boolean_t | boolean_t | ||||
pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) | pmap_is_prefaultable(pmap_t pmap, vm_offset_t addr) | ||||
{ | { | ||||
pd_entry_t *pde; | |||||
pt_entry_t *pte; | pt_entry_t *pte; | ||||
boolean_t rv; | boolean_t rv; | ||||
int lvl; | int lvl; | ||||
/* | |||||
* Return TRUE if and only if the L3 entry for the specified virtual | |||||
* address is allocated but invalid. | |||||
*/ | |||||
rv = FALSE; | rv = FALSE; | ||||
PMAP_LOCK(pmap); | PMAP_LOCK(pmap); | ||||
pte = pmap_pte(pmap, addr, &lvl); | pde = pmap_pde(pmap, addr, &lvl); | ||||
if (pte != NULL && pmap_load(pte) != 0) { | if (pde != NULL && lvl == 2) { | ||||
rv = TRUE; | pte = pmap_l2_to_l3(pde, addr); | ||||
rv = pmap_load(pte) == 0; | |||||
} | } | ||||
PMAP_UNLOCK(pmap); | PMAP_UNLOCK(pmap); | ||||
return (rv); | return (rv); | ||||
} | } | ||||
/* | /* | ||||
* pmap_is_referenced: | * pmap_is_referenced: | ||||
* | * | ||||
▲ Show 20 Lines • Show All 1,955 Lines • Show Last 20 Lines |