Kernel: Zero initialize Processors
This moves processor array to .bss reducing data size by 8192 bytes :) This needed GCC updated to 15.2.0 because of an internal compiler error I found :)
This commit is contained in:
parent
e7b518ba67
commit
f926e599fa
|
@ -158,7 +158,7 @@ namespace Kernel
|
|||
static BAN::Atomic<bool> s_is_smp_enabled;
|
||||
static BAN::Atomic<bool> s_should_print_cpu_load;
|
||||
|
||||
ProcessorID m_id { PROCESSOR_NONE };
|
||||
ProcessorID m_id { 0 };
|
||||
|
||||
static constexpr size_t s_stack_size { 4096 };
|
||||
void* m_stack { nullptr };
|
||||
|
|
|
@ -47,6 +47,10 @@ namespace Kernel
|
|||
if (s_bsp_id == PROCESSOR_NONE || id == PROCESSOR_NONE || id.m_id >= s_processors.size())
|
||||
Kernel::panic("Trying to initialize invalid processor {}", id.m_id);
|
||||
|
||||
if (id == s_bsp_id)
|
||||
for (auto& processor : s_processors)
|
||||
processor.m_id = PROCESSOR_NONE;
|
||||
|
||||
auto& processor = s_processors[id.m_id];
|
||||
|
||||
ASSERT(processor.m_id == PROCESSOR_NONE);
|
||||
|
|
Loading…
Reference in New Issue