Kernel: Save BSB id

This commit is contained in:
2024-03-06 00:36:09 +02:00
parent 58aca68726
commit f84df175ce
2 changed files with 11 additions and 2 deletions

View File

@@ -31,11 +31,12 @@ namespace Kernel
asm volatile("movw %%gs, %0" : "=rm"(id));
return id;
}
static Processor& get(ProcessorID);
static Processor& current() { return get(current_id()); }
static ProcessorID bsb_id() { return s_bsb_id; }
static bool current_is_bsb() { return current_id() == bsb_id(); }
static void set_interrupt_state(InterruptState state)
{
if (state == InterruptState::Enabled)
@@ -73,6 +74,8 @@ namespace Kernel
~Processor();
private:
static ProcessorID s_bsb_id;
void* m_stack { nullptr };
static constexpr size_t m_stack_size { 4096 };