This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 4d285cb14d xtensa_saveusercontext:Leave the context information empty
4d285cb14d is described below
commit 4d285cb14d3b34ae8b1e00adef6c3cd4bb597bc7
Author: chenrun1 <[email protected]>
AuthorDate: Wed Jun 21 21:02:48 2023 +0800
xtensa_saveusercontext:Leave the context information empty
In the current implementation of other architectures, it is not really
implemented to preserve the context, so it is emulated from other architectures
to clear the context.
If this behavior is not implemented, it will cause the xtensa architecture
processor to loop assert in the active assert case
Signed-off-by: chenrun1 <[email protected]>
---
arch/xtensa/src/common/xtensa_saveusercontext.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/xtensa/src/common/xtensa_saveusercontext.c
b/arch/xtensa/src/common/xtensa_saveusercontext.c
index 5d436674ee..06c3cbb147 100644
--- a/arch/xtensa/src/common/xtensa_saveusercontext.c
+++ b/arch/xtensa/src/common/xtensa_saveusercontext.c
@@ -23,6 +23,9 @@
****************************************************************************/
#include <nuttx/config.h>
+#include <nuttx/irq.h>
+
+#include <string.h>
#include <arch/syscall.h>
@@ -46,5 +49,13 @@
int up_saveusercontext(void *saveregs)
{
+ if (up_interrupt_context())
+ {
+ /* TODO: save interrupt context */
+
+ memset(saveregs, 0x0, XCPTCONTEXT_SIZE);
+ return 0;
+ }
+
return sys_call1(SYS_save_context, (uintptr_t)saveregs);
}