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:
Bananymous 2025-08-25 18:26:13 +03:00
parent e7b518ba67
commit f926e599fa
2 changed files with 5 additions and 1 deletions

View File

@ -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 };

View File

@ -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);