mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #827 from adamgreen/rtxNoStackCheckForMainThread
RTOS: Main thread should not write MAGIC_WORD to stackpull/809/head
commit
fdc60ac217
|
@ -547,18 +547,19 @@ osThreadId svcThreadCreate (osThreadDef_t *thread_def, void *argument) {
|
||||||
U8 priority = thread_def->tpriority - osPriorityIdle + 1;
|
U8 priority = thread_def->tpriority - osPriorityIdle + 1;
|
||||||
P_TCB task_context = &thread_def->tcb;
|
P_TCB task_context = &thread_def->tcb;
|
||||||
|
|
||||||
/* If "size != 0" use a private user provided stack. */
|
/* Utilize the user provided stack. */
|
||||||
task_context->stack = (U32*)thread_def->stack_pointer;
|
task_context->stack = (U32*)thread_def->stack_pointer;
|
||||||
task_context->priv_stack = thread_def->stacksize;
|
task_context->priv_stack = thread_def->stacksize;
|
||||||
/* Pass parameter 'argv' to 'rt_init_context' */
|
|
||||||
task_context->msg = argument;
|
|
||||||
/* For 'size == 0' system allocates the user stack from the memory pool. */
|
|
||||||
rt_init_context (task_context, priority, (FUNCP)thread_def->pthread);
|
|
||||||
|
|
||||||
/* Find a free entry in 'os_active_TCB' table. */
|
/* Find a free entry in 'os_active_TCB' table. */
|
||||||
OS_TID tsk = rt_get_TID ();
|
OS_TID tsk = rt_get_TID ();
|
||||||
os_active_TCB[tsk-1] = task_context;
|
os_active_TCB[tsk-1] = task_context;
|
||||||
task_context->task_id = tsk;
|
task_context->task_id = tsk;
|
||||||
|
/* Pass parameter 'argv' to 'rt_init_context' */
|
||||||
|
task_context->msg = argument;
|
||||||
|
/* Initialize thread context structure, including the thread's stack. */
|
||||||
|
rt_init_context (task_context, priority, (FUNCP)thread_def->pthread);
|
||||||
|
|
||||||
|
/* Dispatch this task to the scheduler for execution. */
|
||||||
DBG_TASK_NOTIFY(task_context, __TRUE);
|
DBG_TASK_NOTIFY(task_context, __TRUE);
|
||||||
rt_dispatch (task_context);
|
rt_dispatch (task_context);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue