Initialize stack area in _NewContext()

Instead of initializing the stack (when INIT_STACKS is enabled) in start_task()
and _fiber_start(), do it in _NewContext().  This helps to both reduce code
duplication AND ensure that all contexts get an initialized stack (previously
the background/idle task's was missed).

Change-Id: If2d50309d2be48fac937f5d0ae96b9de185c0fe2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
Peter Mitsis 2015-05-25 14:31:59 -04:00 committed by Anas Nashif
commit 4fe98a46f5
5 changed files with 12 additions and 8 deletions

View file

@ -208,10 +208,6 @@ void start_task(struct k_proc *X, /* ptr to task control block */
/* Note: the field X->worksize now represents the task size in bytes */
#ifdef CONFIG_INIT_STACKS
memset(X->workspace, 0xaa, X->worksize);
#endif
contextOptions = 0;
_START_TASK_ARCH(X, &contextOptions);