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/incubator-nuttx.git

commit 2dcbf28f15783b30fde57ce99626b41587fff8b6
Author: Abdelatif Guettouche <abdelatif.guettou...@espressif.com>
AuthorDate: Fri Mar 11 16:23:57 2022 +0100

    xtensa_context.S: A1 should be restored by the caller not
    xtensa_context_resotred. Here it was being restored twice.
    Remove the one in xtensa_context_restore.
    
    Signed-off-by: Abdelatif Guettouche <abdelatif.guettou...@espressif.com>
---
 arch/xtensa/src/common/xtensa_context.S      | 1 -
 arch/xtensa/src/common/xtensa_int_handlers.S | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/xtensa/src/common/xtensa_context.S 
b/arch/xtensa/src/common/xtensa_context.S
index 03f5772..6b8d2eb 100644
--- a/arch/xtensa/src/common/xtensa_context.S
+++ b/arch/xtensa/src/common/xtensa_context.S
@@ -279,7 +279,6 @@ _xtensa_context_restore:
 
        l32i    a3, a2, (4 * REG_SAR)
        wsr             a3, SAR
-       l32i    sp, a2, (4 * REG_A1)
        l32i    a3, a2, (4 * REG_A3)
        l32i    a4, a2, (4 * REG_A4)
        l32i    a5, a2, (4 * REG_A5)
diff --git a/arch/xtensa/src/common/xtensa_int_handlers.S 
b/arch/xtensa/src/common/xtensa_int_handlers.S
index b649e8d..c83d4cc 100644
--- a/arch/xtensa/src/common/xtensa_int_handlers.S
+++ b/arch/xtensa/src/common/xtensa_int_handlers.S
@@ -353,7 +353,7 @@ _xtensa_level1_handler:
        l32i    a0, a2, (4 * REG_PC)                    /* Retrieve 
interruptee's PC */
        wsr             a0, EPC_1
        l32i    a0, a2, (4 * REG_A0)                    /* Retrieve 
interruptee's A0 */
-  l32i  sp, a2, (4 * REG_A1)      /* Remove interrupt stack frame */
+  l32i  sp, a2, (4 * REG_A1)      /* Retrieve interrupt stack frame */
        l32i    a2, a2, (4 * REG_A2)                    /* Retrieve 
interruptee's A2 */
        rsync                                                                   
        /* Ensure PS and EPC written */
 

Reply via email to