Skip to content
Snippets Groups Projects
Commit fc842d74 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

SMP: os_start needs to hold the KMM semaphore to prevent threads from...

SMP: os_start needs to hold the KMM semaphore to prevent threads from allocating memory until the bring-up is complete
parent 8ea1bc31
No related branches found
No related tags found
No related merge requests found
......@@ -726,7 +726,18 @@ void os_start(void)
#ifdef CONFIG_SMP
/* Start all CPUs *********************************************************/
/* A few basic sanity checks */
DEBUGASSERT(this_cpu() == 0 && CONFIG_MAX_TASKS > CONFIG_SMP_NCPUS);
/* Take the memory manager semaphore on this CPU so that it will not be
* available on the other CPUs until we have finished initialization.
*/
DEBUGVERIFY(kmm_trysemaphore());
/* Then start the other CPUs */
DEBUGVERIFY(os_smpstart());
#endif /* CONFIG_SMP */
......@@ -740,6 +751,13 @@ void os_start(void)
DEBUGVERIFY(os_bringup());
#ifdef CONFIG_SMP
/* Let other threads have access to the memory manager */
kmm_givesemaphore();
#endif /* CONFIG_SMP */
/* The IDLE Loop **********************************************************/
/* When control is return to this point, the system is idle. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment