From cf1bddb5a9d7a484044cb74e6580c739f254e115 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sun, 1 Jun 2025 19:54:55 -0400 Subject: kernel/amd64: mp: Add BSP to `ci_list' Signed-off-by: Ian Moffett --- sys/arch/amd64/amd64/mp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/arch') diff --git a/sys/arch/amd64/amd64/mp.c b/sys/arch/amd64/amd64/mp.c index fe0dd9f..1e6d8d9 100644 --- a/sys/arch/amd64/amd64/mp.c +++ b/sys/arch/amd64/amd64/mp.c @@ -46,7 +46,7 @@ static volatile struct limine_smp_request g_smp_req = { .revision = 0 }; -static volatile uint32_t ncpu_up = 0; +static volatile uint32_t ncpu_up = 1; static struct cpu_info *ci_list[CPU_MAX]; static struct spinlock ci_list_lock = {0}; @@ -97,6 +97,7 @@ mp_bootstrap_aps(struct cpu_info *ci) cpus = resp->cpus; cpu_init_counter = resp->cpu_count - 1; + ci_list[0] = ci; if (resp->cpu_count == 1) { pr_trace("CPU has 1 core, no APs to bootstrap...\n"); @@ -114,5 +115,5 @@ mp_bootstrap_aps(struct cpu_info *ci) } /* Wait for all cores to be ready */ - while (ncpu_up < cpu_init_counter); + while ((ncpu_up - 1) < cpu_init_counter); } -- cgit v1.2.3