Skip to content

Commit e10048b

Browse files
author
Marek Matej
committed
subsys: debug: xtensa: enable thread awarenes
Enable stack offset switching for Xtensa targets if arch_switch is used. Signed-off-by: Marek Matej <marek.matej@espressif.com>
1 parent 9c1fbc8 commit e10048b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

subsys/debug/thread_info.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,14 @@ const size_t _kernel_thread_info_offsets[] = {
8888
#elif defined(CONFIG_XTENSA)
8989
/* Xtensa does not store stack pointers inside thread objects.
9090
* 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.
91+
* no fixed location for this to work. It needs arch_switch in
92+
* order to work on Xtensa.
9393
*/
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)