You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/18 18:35:03 UTC

[GitHub] [incubator-nuttx] Ouss4 commented on a change in pull request #5248: xtensa: some fixes in interrupt handler

Ouss4 commented on a change in pull request #5248:
URL: https://github.com/apache/incubator-nuttx/pull/5248#discussion_r787043847



##########
File path: arch/xtensa/src/common/xtensa_int_handlers.S
##########
@@ -312,6 +312,7 @@ _xtensa_level1_handler:
 
 	s32i	a2, sp, (4 * REG_A2)
 	mov		a2, sp							      /* Address of state save on stack */
+	s32i	a3, sp, (4 * REG_A3)

Review comment:
       The commit message says that this is similar to `_xtensa_syscall_handler`, it's actually not similar.  In `_xtensa_syscall_handler` we use A3 (and A2) as scratch registers before calling `_xtensa_save_context`, so they are saved.
   Another thing to note regarding `_xtensa_syscall_handler` is that it never restores the first saved A3, but just calls `_xtensa_restore_context` which restores a scratch version of A3 only.
   
   I think when @zhuyanlinzyl removed the A3 save from `_xtensa_save_context` it fixes the issue he had, but I believe we need to organise this a bit more. I think we should fix how `_xtensa_syscall_handler` restores A3.




-- 
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-unsubscribe@nuttx.apache.org

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