sched: Avoid call up_initial_state for idle thread twice

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iaf5d4bcc915fbe842e9356ea6416f0af869ab116
This commit is contained in:
Xiang Xiao 2020-06-16 21:08:16 +08:00 committed by patacongo
parent 69e97c19ea
commit 56fa98f3ea
2 changed files with 8 additions and 7 deletions

View File

@ -168,11 +168,7 @@ int nx_smp_start(void)
return ret; return ret;
} }
/* Reinitialize the processor-specific portion of the TCB. This is /* Initialize the processor-specific portion of the TCB */
* the second time this has been called for this CPU, but the stack
* was not yet initialized on the first call so we need to do it
* again.
*/
up_initial_state(tcb); up_initial_state(tcb);
} }

View File

@ -528,9 +528,14 @@ void nx_start(void)
g_running_tasks[cpu] = &g_idletcb[cpu].cmn; g_running_tasks[cpu] = &g_idletcb[cpu].cmn;
/* Initialize the processor-specific portion of the TCB */ /* Initialize the 1st processor-specific portion of the TCB
* Note: other idle thread get initialized in nx_smpstart
*/
up_initial_state(&g_idletcb[cpu].cmn); if (cpu == 0)
{
up_initial_state(&g_idletcb[cpu].cmn);
}
} }
/* Task lists are initialized */ /* Task lists are initialized */