Kernel: Move GDT to Processor

This commit is contained in:
2024-03-06 00:02:18 +02:00
parent 8670364f44
commit 58aca68726
6 changed files with 142 additions and 99 deletions

View File

@@ -24,6 +24,10 @@ namespace Kernel
if (m_stack)
kfree(m_stack);
m_stack = nullptr;
if (m_gdt)
delete m_gdt;
m_gdt = nullptr;
}
Processor& Processor::get(ProcessorID id)
@@ -31,4 +35,13 @@ namespace Kernel
return s_processors[id];
}
void Processor::initialize()
{
ASSERT(this == &Processor::current());
ASSERT(m_gdt == nullptr);
m_gdt = GDT::create();
ASSERT(m_gdt);
}
}