mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
smp: fix race between cpu exposure and smp init
The SMP code exposes that a cpu woke up before it is properly initialized in sched_ap_entry(). Fix this by initializing it first, exposing it and then stopping the bootstrap thread.
This commit is contained in:
@@ -50,8 +50,11 @@ static void cpuwakeup(struct limine_mp_info *info) {
|
||||
arch_profiling_init();
|
||||
#endif
|
||||
|
||||
__atomic_add_fetch(&arch_smp_cpusawake, 1, __ATOMIC_SEQ_CST);
|
||||
sched_ap_entry();
|
||||
|
||||
__atomic_add_fetch(&arch_smp_cpusawake, 1, __ATOMIC_SEQ_CST);
|
||||
|
||||
sched_stop_current_thread();
|
||||
}
|
||||
|
||||
void arch_smp_send_ipi(cpu_t *targcpu, isr_t *isr, int target, bool nmi) {
|
||||
|
||||
Reference in New Issue
Block a user