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

View File

@@ -232,10 +232,9 @@ namespace Kernel
dprintln("Trying to enable processor (lapic id {})", processor.apic_id);
Kernel::Processor::create(processor.processor_id);
auto& proc = Kernel::Processor::create(processor.processor_id);
PageTable::with_fast_page((paddr_t)g_ap_init_addr, [&] {
PageTable::fast_page_as_sized<uint32_t>(2) = V2P(Kernel::Processor::get(processor.processor_id).stack_top());
PageTable::fast_page_as_sized<uint32_t>(2) = V2P(proc.stack_top());
});
*g_ap_stack_loaded = 0;