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

@@ -34,23 +34,23 @@ namespace Kernel
BAN_NON_MOVABLE(IDT);
public:
static IDT* create();
static IDT* create(bool is_bsb);
[[noreturn]] static void force_triple_fault();
void register_irq_handler(uint8_t irq, Interruptable* interruptable);
void load()
{
asm volatile("lidt %0" :: "m"(m_idtr) : "memory");
}
private:
IDT() = default;
void register_interrupt_handler(uint8_t index, void (*handler)());
void register_syscall_handler(uint8_t index, void (*handler)());
void flush()
{
asm volatile("lidt %0" :: "m"(m_idtr) : "memory");
}
private:
BAN::Array<GateDescriptor, 0x100> m_idt;
IDTR m_idtr {