ports/Xtensa: Update Xtensa support#525
Conversation
Also fix inconsistent SWPRI define in interrupt handler
- Disable interrupts prior to allocating a large exception frame; only reenable them after deallocating the extra memory. - Any user tasks with stacks based on TX_MINIMUM_STACK do not have sufficient space for both a context switch frame and an ISR frame; ill-timed interrupts were causing stack overruns.
- Must reload register trashed by notify hook function call - Must ensure PS.WOE is set before using call8 - Remove unused XT_USE_INT_WRAPPER define and associated changes, which had a bug in XEA2 usage - Fix another case where enabling the thread notify hooks for call0 ABI corrupted a register
- ThreadX change to handle dynamic reent for both newlib and xclib - Adapt ThreadX xclib interface code to handle dynamic reent pointers
- Update upstream execution profiling for Xtensa port
- tx_execution_profile.h now defines an Xtensa example in addition to the existing Cortex example
|
Hi @ianstcdns. Thank you for this contribution! At least one of us will review and provide feedback. |
|
@fdesbiens thank you for taking a look. I have not submitted PRs to eclipse projects before, so please LMK if there is any part of the process I may have missed or additional steps required. Thanks in advance. |
|
@fdesbiens I'm not seeing any details on today's failures--all it says is "Error:". If these are due to my code changes, could you please point me to where I can find logs or reports? |
|
Hi @ianstcdns. I started reviewing the PR. We have some broken Cortex-M CI/CD builds right now. Your PR ver nearly passed the standard regression tests, but there was one specific test which timed out - which happens sometimes when GitGub infrastructure is under load. I will rerun the tests locally. So, nothing to be worried about. Expect my feedback this week. |
fdesbiens
left a comment
There was a problem hiding this comment.
Good contribution overall, @ianstcdns. I would recommend making one specific change.
There was a problem hiding this comment.
When thread_ptr is NULL and neither XTHAL_CLIB_XCLIB nor XTHAL_CLIB_NEWLIB is defined, the function falls through with no return value — this is undefined behaviour that could crash or corrupt state at runtime.
Suggested fix: Convert the #if/#if chain to #if/#elif/#else and add a compile-time error for unsupported configurations:
#if XSHAL_CLIB == XTHAL_CLIB_XCLIB
extern struct _reent g_reent;
return &g_reent;
#elif XSHAL_CLIB == XTHAL_CLIB_NEWLIB
extern struct _reent *_impure_ptr;
return _impure_ptr;
#else
#error "Unsupported C library for __DYNAMIC_REENT__"
#endifThere was a problem hiding this comment.
Good catch! Thanks. I'll make this change shortly.
- Prevent a fall-through with no return value when neither xclib nor newlib are used.
Includes the following Xtensa port updates from Cadence foss-xtensa fork:
All updates verified internally on multiple Xtensa configurations
PR checklist