Kernel/aarch64: Add helper to get the current TTBR0_EL1
This commit is contained in:
parent
d9946c8e89
commit
9e90932bfb
Notes:
sideshowbarker
2024-07-17 01:09:50 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/9e90932bfb Pull-request: https://github.com/SerenityOS/serenity/pull/16911 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/nico ✅
1 changed files with 8 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Reference in a new issue