Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/efirt_machdep.c
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | efi_arch_enter(void) | ||||
return (0); | return (0); | ||||
} | } | ||||
void | void | ||||
efi_arch_leave(void) | efi_arch_leave(void) | ||||
{ | { | ||||
struct thread *td; | struct thread *td; | ||||
/* | |||||
* Restore the pcpu pointer. Some UEFI implementations trash it and | |||||
* we don't store it before calling into them. To fix this we need | |||||
* to restore it after returning to the kernel context. As reading | |||||
* curthread will access x18 we need to restore it before loading | |||||
* the thread pointer. | |||||
*/ | |||||
__asm __volatile( | |||||
"mrs x18, tpidr_el1 \n" | |||||
); | |||||
td = curthread; | td = curthread; | ||||
__asm __volatile( | __asm __volatile( | ||||
"msr ttbr0_el1, %0 \n" | "msr ttbr0_el1, %0 \n" | ||||
"dsb ishst \n" | "dsb ishst \n" | ||||
"tlbi vmalle1is \n" | "tlbi vmalle1is \n" | ||||
"dsb ish \n" | "dsb ish \n" | ||||
"isb \n" | "isb \n" | ||||
: : "r"(td->td_proc->p_md.md_l0addr)); | : : "r"(td->td_proc->p_md.md_l0addr)); | ||||
} | } | ||||
int | int | ||||
efi_rt_arch_call(struct efirt_callinfo *ec) | efi_rt_arch_call(struct efirt_callinfo *ec) | ||||
{ | { | ||||
panic("not implemented"); | panic("not implemented"); | ||||
} | } |