Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/pmap.c
Show First 20 Lines • Show All 1,641 Lines • ▼ Show 20 Lines | pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) | ||||
PMAP_UNLOCK(pmap); | PMAP_UNLOCK(pmap); | ||||
return (m); | return (m); | ||||
} | } | ||||
/* | /* | ||||
* Walks the page tables to translate a kernel virtual address to a | * Walks the page tables to translate a kernel virtual address to a | ||||
* physical address. Returns true if the kva is valid and stores the | * physical address. Returns true if the kva is valid and stores the | ||||
* physical address in pa if it is not NULL. | * physical address in pa if it is not NULL. | ||||
* | |||||
* See the comment above data_abort() for the rationale for specifying | |||||
* NO_PERTHREAD_SSP here. | |||||
*/ | */ | ||||
bool | bool NO_PERTHREAD_SSP | ||||
pmap_klookup(vm_offset_t va, vm_paddr_t *pa) | pmap_klookup(vm_offset_t va, vm_paddr_t *pa) | ||||
{ | { | ||||
pt_entry_t *pte, tpte; | pt_entry_t *pte, tpte; | ||||
register_t intr; | register_t intr; | ||||
uint64_t par; | uint64_t par; | ||||
/* | /* | ||||
* Disable interrupts so we don't get interrupted between asking | * Disable interrupts so we don't get interrupted between asking | ||||
▲ Show 20 Lines • Show All 5,387 Lines • ▼ Show 20 Lines | |||||
struct pcb * | struct pcb * | ||||
pmap_switch(struct thread *new) | pmap_switch(struct thread *new) | ||||
{ | { | ||||
pcpu_bp_harden bp_harden; | pcpu_bp_harden bp_harden; | ||||
struct pcb *pcb; | struct pcb *pcb; | ||||
/* Store the new curthread */ | /* Store the new curthread */ | ||||
PCPU_SET(curthread, new); | PCPU_SET(curthread, new); | ||||
#if defined(PERTHREAD_SSP) | |||||
/* Set the new threads SSP canary */ | |||||
__asm("msr sp_el0, %0" :: "r"(&new->td_md.md_canary)); | |||||
#endif | |||||
/* And the new pcb */ | /* And the new pcb */ | ||||
pcb = new->td_pcb; | pcb = new->td_pcb; | ||||
PCPU_SET(curpcb, pcb); | PCPU_SET(curpcb, pcb); | ||||
/* | /* | ||||
* TODO: We may need to flush the cache here if switching | * TODO: We may need to flush the cache here if switching | ||||
* to a user process. | * to a user process. | ||||
▲ Show 20 Lines • Show All 565 Lines • Show Last 20 Lines |