mirror of https://github.com/ARMmbed/mbed-os.git
RTX: Actively switch to the idle thread
Prevent a switch to a NULL target thread by setting the new task to run to be the idle task. Otherwise, we get nasty usage fault because we would be returning from the rt_sys_init SVC with a PSP of 0x20.pull/1753/head
parent
58336594ac
commit
829ca3333b
|
|
@ -406,6 +406,10 @@ void rt_sys_init (FUNCP first_task, U32 prio_stksz, void *stk) {
|
|||
os_tsk.run = &os_idle_TCB;
|
||||
os_tsk.run->state = RUNNING;
|
||||
|
||||
/* Set the current thread to idle, so that on exit from this SVCall we do not
|
||||
* de-reference a NULL TCB. */
|
||||
rt_switch_req(&os_idle_TCB);
|
||||
|
||||
/* Initialize ps queue */
|
||||
os_psq->first = 0U;
|
||||
os_psq->last = 0U;
|
||||
|
|
|
|||
Loading…
Reference in New Issue