mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-13 00:09:19 +00:00
scheduler: Fix page table switch for scheduler
The userspace process may map pages where the kernel has allocated data and cause a crash. This patch fixes this issue by having a separate IRQ handler which sets the kernel page table at the start of SchedulerInterruptHandler() and restores it in SchedulerHandlerStub() function.
This commit is contained in:
@ -356,10 +356,10 @@ namespace Tasking
|
||||
|
||||
/* CPU state */
|
||||
#if defined(a64)
|
||||
CPU::x64::TrapFrame Registers{};
|
||||
CPU::x64::SchedulerFrame Registers{};
|
||||
uintptr_t ShadowGSBase, GSBase, FSBase;
|
||||
#elif defined(a32)
|
||||
CPU::x32::TrapFrame Registers{};
|
||||
CPU::x32::SchedulerFrame Registers{};
|
||||
uintptr_t ShadowGSBase, GSBase, FSBase;
|
||||
#elif defined(aa64)
|
||||
uintptr_t Registers; // TODO
|
||||
|
Reference in New Issue
Block a user