1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 15:27:34 +00:00

Kernel/aarch64: Implement switching page directories

The code in PageDirectory.cpp now keeps track of the registered page
directories, and actually sets the TTBR0_EL1 to the page table base of
the currently executing thread. When context switching, we now also
change the TTBR0_EL1 to the page table base of the thread that we
context switch into.
This commit is contained in:
Timon Kruiper 2023-01-24 19:31:25 +01:00 committed by Andreas Kling
parent 1f30a5e4d9
commit 1d58663298
2 changed files with 27 additions and 10 deletions

View file

@ -409,6 +409,11 @@ extern "C" void enter_thread_context(Thread* from_thread, Thread* to_thread)
Processor::set_current_thread(*to_thread);
auto& from_regs = from_thread->regs();
auto& to_regs = to_thread->regs();
if (from_regs.ttbr0_el1 != to_regs.ttbr0_el1)
Aarch64::Asm::set_ttbr0_el1(to_regs.ttbr0_el1);
to_thread->set_cpu(Processor::current().id());
auto in_critical = to_thread->saved_critical();