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/04/12 12:26:26 UTC

[GitHub] [incubator-nuttx] pussuw commented on a diff in pull request #6052: arch/riscv: Jump instead call riscv_dispatch_syscall

pussuw commented on code in PR #6052:
URL: https://github.com/apache/incubator-nuttx/pull/6052#discussion_r848375189


##########
arch/risc-v/include/syscall.h:
##########
@@ -124,16 +124,10 @@
 #define SYS_signal_handler_return (7)
 #endif /* !CONFIG_BUILD_FLAT */
 
-#if defined (CONFIG_ARCH_USE_S_MODE) && defined (__KERNEL__)
-#  define ASM_SYS_CALL \
-     " addi sp, sp, -16\n"                  /* Make room */ \
-     REGSTORE " ra, 0(sp)\n"                /* Save ra */ \
-     " jal  ra, riscv_dispatch_syscall\n"   /* Dispatch (modifies ra) */ \
-     REGLOAD " ra, 0(sp)\n"                 /* Restore ra */ \
-     " addi sp, sp, 16\n"                   /* Restore sp */
+#if defined(CONFIG_ARCH_USE_S_MODE) && defined(__KERNEL__)
+#  define ASM_SYS_CALL "j riscv_dispatch_syscall\n"

Review Comment:
   I don't think this will work, up_signal_dispatch actually returns here and now the software will simply get lost. ecall knows where to return since it sets EPC.



-- 
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