Xtensa port: Added missing initalization of thread base sturct in _new_thread.

Change-Id: Icf9e1e6d5f831c2cf6e1262c6f8e1a46356edfe7
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
This commit is contained in:
Mazen NEIFER 2017-01-30 18:57:20 +01:00 committed by Andrew Boie
commit 7c75da1e1a
2 changed files with 15 additions and 3 deletions

View file

@ -135,8 +135,21 @@ void _new_thread(char *pStack, size_t stackSize,
#endif #endif
tcs->callee_saved.topOfStack = pInitCtx; tcs->callee_saved.topOfStack = pInitCtx;
tcs->arch.flags = 0; tcs->arch.flags = 0;
tcs->arch.prio = prio; _init_thread_base(&tcs->base, prio, _THREAD_PRESTART, options);
/* static threads overwrite it afterwards with real value */
tcs->init_data = NULL;
tcs->fn_abort = NULL;
#ifdef CONFIG_THREAD_CUSTOM_DATA
/* Initialize custom data field (value is opaque to kernel) */
tcs->custom_data = NULL;
#endif
#ifdef CONFIG_THREAD_MONITOR
/*
* In debug mode tcs->entry give direct access to the thread entry
* and the corresponding parameters.
*/
tcs->entry = (struct __thread_entry *)(pInitCtx);
#endif
/* initial values in all other registers/TCS entries are irrelevant */ /* initial values in all other registers/TCS entries are irrelevant */
THREAD_MONITOR_INIT(tcs); THREAD_MONITOR_INIT(tcs);

View file

@ -134,7 +134,6 @@ struct _thread_arch {
* offset to read the 'flags' field. * offset to read the 'flags' field.
*/ */
uint32_t flags; uint32_t flags;
int prio; /* thread priority used to sort linked list */
#ifdef CONFIG_THREAD_CUSTOM_DATA #ifdef CONFIG_THREAD_CUSTOM_DATA
void *custom_data; /* available for custom use */ void *custom_data; /* available for custom use */
#endif #endif