Changeset View
Changeset View
Standalone View
Standalone View
head/sys/arm64/arm64/pmap.c
Show First 20 Lines • Show All 902 Lines • ▼ Show 20 Lines | __asm __volatile( | ||||
"tlbi vaae1is, %0 \n" | "tlbi vaae1is, %0 \n" | ||||
"dsb ish \n" | "dsb ish \n" | ||||
"isb \n" | "isb \n" | ||||
: : "r"(va >> PAGE_SHIFT)); | : : "r"(va >> PAGE_SHIFT)); | ||||
sched_unpin(); | sched_unpin(); | ||||
} | } | ||||
static __inline void | static __inline void | ||||
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) | pmap_invalidate_range_nopin(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) | ||||
{ | { | ||||
vm_offset_t addr; | vm_offset_t addr; | ||||
sched_pin(); | |||||
dsb(ishst); | dsb(ishst); | ||||
for (addr = sva; addr < eva; addr += PAGE_SIZE) { | for (addr = sva; addr < eva; addr += PAGE_SIZE) { | ||||
__asm __volatile( | __asm __volatile( | ||||
"tlbi vaae1is, %0" : : "r"(addr >> PAGE_SHIFT)); | "tlbi vaae1is, %0" : : "r"(addr >> PAGE_SHIFT)); | ||||
} | } | ||||
__asm __volatile( | __asm __volatile( | ||||
"dsb ish \n" | "dsb ish \n" | ||||
"isb \n"); | "isb \n"); | ||||
} | |||||
static __inline void | |||||
pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) | |||||
{ | |||||
sched_pin(); | |||||
pmap_invalidate_range_nopin(pmap, sva, eva); | |||||
sched_unpin(); | sched_unpin(); | ||||
} | } | ||||
static __inline void | static __inline void | ||||
pmap_invalidate_all(pmap_t pmap) | pmap_invalidate_all(pmap_t pmap) | ||||
{ | { | ||||
sched_pin(); | sched_pin(); | ||||
▲ Show 20 Lines • Show All 1,730 Lines • ▼ Show 20 Lines | pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_entry_t newpte, | ||||
* inconsistent state. We also need to ensure no interrupts fire | * inconsistent state. We also need to ensure no interrupts fire | ||||
* as they may make use of an address we are about to invalidate. | * as they may make use of an address we are about to invalidate. | ||||
*/ | */ | ||||
intr = intr_disable(); | intr = intr_disable(); | ||||
critical_enter(); | critical_enter(); | ||||
/* Clear the old mapping */ | /* Clear the old mapping */ | ||||
pmap_load_clear(pte); | pmap_load_clear(pte); | ||||
pmap_invalidate_range(pmap, va, va + size); | pmap_invalidate_range_nopin(pmap, va, va + size); | ||||
/* Create the new mapping */ | /* Create the new mapping */ | ||||
pmap_load_store(pte, newpte); | pmap_load_store(pte, newpte); | ||||
critical_exit(); | critical_exit(); | ||||
intr_restore(intr); | intr_restore(intr); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,204 Lines • Show Last 20 Lines |