Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/pmap.c
Show First 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | pmap_l3(pmap_t pmap, vm_offset_t va) | ||||
l2 = pmap_l2(pmap, va); | l2 = pmap_l2(pmap, va); | ||||
if (l2 == NULL || (*l2 & ATTR_DESCR_MASK) != L2_TABLE) | if (l2 == NULL || (*l2 & ATTR_DESCR_MASK) != L2_TABLE) | ||||
return (NULL); | return (NULL); | ||||
return (pmap_l2_to_l3(l2, va)); | return (pmap_l2_to_l3(l2, va)); | ||||
} | } | ||||
bool | |||||
pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_t **l1, pd_entry_t **l2, | |||||
pt_entry_t **l3) | |||||
{ | |||||
pd_entry_t *l1p, *l2p; | |||||
if (pmap->pm_l1 == NULL) | |||||
return (false); | |||||
l1p = pmap_l1(pmap, va); | |||||
*l1 = l1p; | |||||
if ((*l1p & ATTR_DESCR_MASK) == L1_BLOCK) { | |||||
*l2 = NULL; | |||||
*l3 = NULL; | |||||
return (true); | |||||
} | |||||
if ((*l1p & ATTR_DESCR_MASK) != L1_TABLE) | |||||
return (false); | |||||
l2p = pmap_l1_to_l2(l1p, va); | |||||
*l2 = l2p; | |||||
if ((*l2p & ATTR_DESCR_MASK) == L2_BLOCK) { | |||||
*l3 = NULL; | |||||
return (true); | |||||
} | |||||
*l3 = pmap_l2_to_l3(l2p, va); | |||||
return (true); | |||||
} | |||||
/* | /* | ||||
* These load the old table data and store the new value. | * These load the old table data and store the new value. | ||||
* They need to be atomic as the System MMU may write to the table at | * They need to be atomic as the System MMU may write to the table at | ||||
* the same time as the CPU. | * the same time as the CPU. | ||||
*/ | */ | ||||
#define pmap_load_store(table, entry) atomic_swap_64(table, entry) | #define pmap_load_store(table, entry) atomic_swap_64(table, entry) | ||||
#define pmap_set(table, mask) atomic_set_64(table, mask) | #define pmap_set(table, mask) atomic_set_64(table, mask) | ||||
#define pmap_load_clear(table) atomic_swap_64(table, 0) | #define pmap_load_clear(table) atomic_swap_64(table, 0) | ||||
▲ Show 20 Lines • Show All 599 Lines • ▼ Show 20 Lines | |||||
* within that region, leaving '*virt' unchanged. Other | * within that region, leaving '*virt' unchanged. Other | ||||
* architectures should map the pages starting at '*virt' and | * architectures should map the pages starting at '*virt' and | ||||
* update '*virt' with the first usable address after the mapped | * update '*virt' with the first usable address after the mapped | ||||
* region. | * region. | ||||
*/ | */ | ||||
vm_offset_t | vm_offset_t | ||||
pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) | pmap_map(vm_offset_t *virt, vm_paddr_t start, vm_paddr_t end, int prot) | ||||
{ | { | ||||
return PHYS_TO_DMAP(start); | return PHYS_TO_DMAP(start); | ||||
} | } | ||||
/* | /* | ||||
* Add a list of wired pages to the kva | * Add a list of wired pages to the kva | ||||
* this routine is only used for temporary | * this routine is only used for temporary | ||||
* kernel mappings that do not need to have | * kernel mappings that do not need to have | ||||
▲ Show 20 Lines • Show All 2,174 Lines • Show Last 20 Lines |