From 271b9b8da3a5c05fe03df4869a688b8ea33cf205 Mon Sep 17 00:00:00 2001 From: James Mintram Date: Wed, 24 Nov 2021 20:09:43 +0000 Subject: Kernel: Set up and activate the MMU in the aarch64 perkernel --- Kernel/Arch/aarch64/Aarch64Asm.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Kernel/Arch/aarch64') diff --git a/Kernel/Arch/aarch64/Aarch64Asm.h b/Kernel/Arch/aarch64/Aarch64Asm.h index 41276949c5..ceeb362316 100644 --- a/Kernel/Arch/aarch64/Aarch64Asm.h +++ b/Kernel/Arch/aarch64/Aarch64Asm.h @@ -10,6 +10,22 @@ namespace Kernel { +inline void set_ttbr1_el1(FlatPtr ttbr1_el1) +{ + asm("msr ttbr1_el1, %[value]" ::[value] "r"(ttbr1_el1)); +} + +inline void set_ttbr0_el1(FlatPtr ttbr0_el1) +{ + asm("msr ttbr0_el1, %[value]" ::[value] "r"(ttbr0_el1)); +} + +inline void flush() +{ + asm("dsb ish"); + asm("isb"); +} + [[noreturn]] inline void halt() { for (;;) { -- cgit v1.2.3