diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index d8534e60c09..8cffd035d00 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -758,6 +758,13 @@ void nx_start(void) syslog_initialize(); + /* Disables context switching beacuse we need take the memory manager + * semaphore on this CPU so that it will not be available on the other + * CPUs until we have finished initialization. + */ + + sched_lock(); + #ifdef CONFIG_SMP /* Start all CPUs *********************************************************/ @@ -781,6 +788,10 @@ void nx_start(void) DEBUGVERIFY(nx_bringup()); + /* Let other threads have access to the memory manager */ + + sched_unlock(); + /* The IDLE Loop **********************************************************/ /* When control is return to this point, the system is idle. */