Kernel/aarch64: Add helper to get the current TTBR0_EL1

This commit is contained in:
Timon Kruiper 2023-01-24 19:25:45 +01:00 committed by Andreas Kling
parent d9946c8e89
commit 9e90932bfb
Notes: sideshowbarker 2024-07-17 01:09:50 +09:00

View file

@ -24,6 +24,14 @@ inline void set_ttbr0_el1(FlatPtr ttbr0_el1)
asm("msr ttbr0_el1, %[value]" ::[value] "r"(ttbr0_el1));
}
inline FlatPtr get_ttbr0_el1()
{
FlatPtr ttbr0_el1;
asm("mrs %[value], ttbr0_el1\n"
: [value] "=r"(ttbr0_el1));
return ttbr0_el1;
}
inline void set_sp_el1(FlatPtr sp_el1)
{
asm("msr sp_el1, %[value]" ::[value] "r"(sp_el1));