From f0a5777a26646ec49b0767b42ffb57e9a05217d1 Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Tue, 8 Mar 2022 10:51:36 +0100 Subject: [PATCH] xtensa_swint.c: Restore the coprocessor state at the end for consistency. Signed-off-by: Abdelatif Guettouche --- arch/xtensa/src/common/xtensa_swint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/xtensa/src/common/xtensa_swint.c b/arch/xtensa/src/common/xtensa_swint.c index bacdc5f767..42c0ef6aa7 100644 --- a/arch/xtensa/src/common/xtensa_swint.c +++ b/arch/xtensa/src/common/xtensa_swint.c @@ -131,12 +131,12 @@ int xtensa_swint(int irq, void *context, void *arg) case SYS_restore_context: { + DEBUGASSERT(regs[REG_A3] != 0); + CURRENT_REGS = (uint32_t *)regs[REG_A3]; #if XCHAL_CP_NUM > 0 cpstate = (uintptr_t)regs[REG_A3] + cpstate_off; xtensa_coproc_restorestate((struct xtensa_cpstate_s *)cpstate); #endif - DEBUGASSERT(regs[REG_A3] != 0); - CURRENT_REGS = (uint32_t *)regs[REG_A3]; } break;