gustavonihei commented on a change in pull request #5729:
URL: https://github.com/apache/incubator-nuttx/pull/5729#discussion_r825341976



##########
File path: arch/xtensa/src/common/xtensa_context.S
##########
@@ -164,16 +161,28 @@ _xtensa_context_save:
 #error Overlay support is not implemented
 #endif
 
-       s32i    a0, a2, (4 * REG_TMP0)                  /* Save return address 
*/
-       s32i    sp, a2, (4 * REG_TMP1)                  /* Save current stack 
pointer */
-       wsr             a2, EXCSAVE_1                                   /* 
Preserve register save area */
-
-       l32i    sp, a2, (4 * REG_A1)                    /* Restore the 
interruptee's SP */
-       call0   _xtensa_window_spill                    /* Preserves only 
a4-a5, a8-a9, a12-a13 */
+    s32i  a0, sp, (4 * REG_TMP0)
+    rsr     a2, PS                     /* to be restored after 
SPILL_ALL_WINDOWS */
+    movi    a0, PS_INTLEVEL_MASK
+    and     a3, a2, a0                 /* get the current INTLEVEL */
+    bgeui   a3, XCHAL_EXCM_LEVEL, 1f   /* calculate max(INTLEVEL, 
XCHAL_EXCM_LEVEL) */

Review comment:
       Nice, didn't know about this one. Thanks for the clarification!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to