Kernel: Store current processor pointer in IA32_GS_BASE

This allows easier access to processors fields
This commit is contained in:
2024-03-07 16:05:29 +02:00
parent efed67cbd0
commit 29fd682672
13 changed files with 119 additions and 98 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ namespace Kernel
ALWAYS_INLINE static void load_temp_stack()
{
asm volatile("movq %0, %%rsp" :: "rm"(Processor::current().stack_top()));
asm volatile("movq %0, %%rsp" :: "rm"(Processor::current_stack_top()));
}
BAN::ErrorOr<void> Scheduler::initialize()
@@ -223,7 +223,7 @@ namespace Kernel
#if SCHEDULER_VERIFY_STACK
vaddr_t rsp;
read_rsp(rsp);
ASSERT(Processor::current().stack_bottom() <= rsp && rsp <= Processor::current().stack_top());
ASSERT(Processor::current_stack_bottom() <= rsp && rsp <= Processor::current_stack_top());
ASSERT(&PageTable::current() == &PageTable::kernel());
#endif
@@ -256,7 +256,7 @@ namespace Kernel
if (current->has_process())
{
current->process().page_table().load();
Processor::current().gdt().set_tss_stack(current->interrupt_stack_base() + current->interrupt_stack_size());
Processor::gdt().set_tss_stack(current->interrupt_stack_base() + current->interrupt_stack_size());
}
else
PageTable::kernel().load();