diff options
-rw-r--r-- | sys/arch/amd64/amd64/mp.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); } |