pussuw commented on code in PR #6052: URL: https://github.com/apache/incubator-nuttx/pull/6052#discussion_r848455326
########## 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 think it would be possible to tailcall here *if* the function prototype was not inline. I still think the ra value does not point to the caller of sys_callx, it points to where the function calling the inlined C-procedure would return. Assembly macro would work, no link is needed for that. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
