From 4d285cb14d3b34ae8b1e00adef6c3cd4bb597bc7 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Wed, 21 Jun 2023 21:02:48 +0800 Subject: [PATCH] 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 --- 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 +#include + +#include #include @@ -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); }