xtensa: fix up_saveusercontext in interrupt context
Summary
Currently, without the change, when assert in interrupt handler, it will show the registers are all zeros. This PR tries to save these registers.
Impact
Testing
Try to trigger an __assert in interrupt handler.
[Experimental Bot, please feedback here]
NuttX PR Requirements Review
Missing Information:
- Summary:
- What functional part of the code is being changed? Be specific. Mention the files, functions, or modules affected.
- How does the change exactly work? Provide technical details about the implementation of register saving.
- Impact:
- You haven't filled out any of the impact sections. Even if the answer is "NO," state that explicitly. Consider these points:
- New Feature? Is this a new debugging capability?
- Build Impact? Are any new build flags introduced?
- Hardware Impact? Does this change depend on specific architectures or have any performance implications?
- Documentation Impact? Does this change how assertions in interrupt handlers are documented?
- You haven't filled out any of the impact sections. Even if the answer is "NO," state that explicitly. Consider these points:
- Testing:
- Build Host(s): Provide specifics about your development environment.
- Target(s): List the architectures and boards where you tested.
- Testing logs: The logs are empty. Show the before/after difference in assert output.
Recommendations:
- Be Specific: Provide concrete details about your changes and their impact.
- Complete All Sections: Address each point in the Impact section, even if it's to state "NO" with a brief explanation.
- Show Your Work: Include relevant code snippets in the Summary and clear, illustrative testing logs.
Example (Summary):
This PR modifies the arch/arm/src/armv7-m/up_assert.c file to save processor registers (R0-R15, PSR, etc.) to a dedicated memory region when an assert is triggered within an interrupt handler. This is achieved by ... [Explain your implementation approach, e.g., using a dedicated exception handler, modifying existing interrupt handling logic, etc.].
Let me know if you have any other questions!