Kernel: Don't even loop over processor when system has only BSP

This commit is contained in:
Bananymous 2024-04-18 13:33:52 +03:00
parent bb061d2a0a
commit 1479b42112
1 changed files with 7 additions and 0 deletions

View File

@ -247,6 +247,13 @@ namespace Kernel
uint8_t bsp_id = Kernel::Processor::current_id(); uint8_t bsp_id = Kernel::Processor::current_id();
dprintln("BSP lapic id: {}", bsp_id); dprintln("BSP lapic id: {}", bsp_id);
if (m_processors.size() == 1)
{
dprintln("Only one processor, skipping AP initialization");
*g_ap_startup_done = 1;
return;
}
for (auto& processor : m_processors) for (auto& processor : m_processors)
{ {
if (processor.apic_id == bsp_id) if (processor.apic_id == bsp_id)