Skip to content

Commit 4b37c39

Browse files
marekmatejsylvioalves
authored andcommitted
xtensa: debug: enable xtensa thread awareness
Enable stack offset switching for Xtensa targets if arch_switch is used. Signed-off-by: Marek Matej <[email protected]>
1 parent 77828f2 commit 4b37c39

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

subsys/debug/thread_info.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,16 @@ const size_t _kernel_thread_info_offsets[] = {
8686
[THREAD_INFO_OFFSET_T_STACK_PTR] = offsetof(struct k_thread,
8787
callee_saved.thread_status),
8888
#elif defined(CONFIG_XTENSA)
89-
/* Xtensa does not store stack pointers inside thread objects.
90-
* The registers are saved in thread stack where there is
91-
* no fixed location for this to work. So mark this as
92-
* unimplemented to avoid the #warning below.
93-
*/
89+
/* Xtensa does not store stack pointers inside thread objects.
90+
* The registers are saved in thread stack where there is
91+
* no fixed location for this to work. It needs arch_switch in
92+
* order to work on Xtensa.
93+
*/
94+
#ifdef CONFIG_USE_SWITCH
95+
[THREAD_INFO_OFFSET_T_STACK_PTR] = offsetof(struct k_thread, switch_handle),
96+
#else
9497
[THREAD_INFO_OFFSET_T_STACK_PTR] = THREAD_INFO_UNIMPLEMENTED,
98+
#endif
9599
#elif defined(CONFIG_RX)
96100
/* RX doesn't store *anything* inside thread objects yet */
97101
[THREAD_INFO_OFFSET_T_STACK_PTR] = THREAD_INFO_UNIMPLEMENTED,

0 commit comments

Comments
 (0)