diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index 6361695fbf..ee98a3db70 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -759,6 +759,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 *********************************************************/ @@ -782,6 +789,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. */