Use the wait-for-event instruction to put the core we have just enabled
to sleep while it waits to start scheduling. The boot core can then use the send-event instruction to wake the cores when they should enter the scheduler. MFC after: 1 week
This commit is contained in:
parent
b51d622ba8
commit
0926af4e2a
@ -185,8 +185,11 @@ init_secondary(int cpu)
|
|||||||
atomic_add_rel_32(&mp_naps, 1);
|
atomic_add_rel_32(&mp_naps, 1);
|
||||||
|
|
||||||
/* Spin until the BSP releases the APs */
|
/* Spin until the BSP releases the APs */
|
||||||
while (!aps_ready)
|
while (!atomic_load_acq_int(&aps_ready)) {
|
||||||
;
|
#if __ARM_ARCH >= 7
|
||||||
|
__asm __volatile("wfe");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize curthread */
|
/* Initialize curthread */
|
||||||
KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
|
KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
|
||||||
@ -353,6 +356,10 @@ release_aps(void *dummy __unused)
|
|||||||
arm_unmask_irq(i);
|
arm_unmask_irq(i);
|
||||||
}
|
}
|
||||||
atomic_store_rel_int(&aps_ready, 1);
|
atomic_store_rel_int(&aps_ready, 1);
|
||||||
|
/* Wake the other threads up */
|
||||||
|
#if __ARM_ARCH >= 7
|
||||||
|
armv7_sev();
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("Release APs\n");
|
printf("Release APs\n");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user