xtensa: THREAD_MONITOR hooks for asm2

You'd this feature would be portable, but it's arch-specific.
Initialize the CONFIG_THREAD_MONITOR stuff, placing the __thread_entry
struct (which AFAICT is dead: nothing in the tree actually reads it)
at the top of the stack.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2017-12-17 12:12:13 -08:00 committed by Anas Nashif
commit 02b2fe1c9e

View file

@ -68,6 +68,15 @@ void _new_thread(struct k_thread *thread, k_thread_stack_t *stack, size_t sz,
_new_thread_init(thread, base, sz, prio, opts);
#ifdef CONFIG_THREAD_MONITOR
top -= sizeof(struct __thread_entry);
thread->entry = (void *)top;
thread->entry->pEntry = entry;
thread_monitor_init(thread);
#endif
thread->switch_handle = xtensa_init_stack((void *)top, entry,
p1, p2, p3);
}