pussuw commented on code in PR #6052: URL: https://github.com/apache/incubator-nuttx/pull/6052#discussion_r859209235
########## 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: Yes this should work. The procedure call to syscallx will do the jump-and-link. I will not have time to test it very soon though as I'm debugging some other issue, I'll update here as I get to this. -- 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]
