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>
diff --git a/arch/xtensa/core/xtensa-asm2.c b/arch/xtensa/core/xtensa-asm2.c
index f9b8200..92e77ed 100644
--- a/arch/xtensa/core/xtensa-asm2.c
+++ b/arch/xtensa/core/xtensa-asm2.c
@@ -68,6 +68,15 @@
_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);
}