pussuw commented on a change in pull request #5782: URL: https://github.com/apache/incubator-nuttx/pull/5782#discussion_r834641431
########## File path: arch/risc-v/include/syscall.h ########## @@ -391,6 +396,64 @@ static inline uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, return r0; } +#ifdef CONFIG_ARCH_USE_S_MODE + +/* In S-mode the kernel cannot ecall to itself, because ecall will raise + * privileges to M-mode, which is not what we want. Instead, use the syscall + * trampoline to do the same. + */ + +static inline uintptr_t ksys_call3(unsigned int nbr, uintptr_t parm1, Review comment: They are called by and needed by e.g. `void up_task_start(main_t taskentry, int argc, char *argv[])` Originally they called sys_callx(), which would turn into ecall(...), the S-mode flag prevents this, and in this case they call ksys_call() instead. I don't know of a way to present the sys_call functions to the user and to the kernel with different implementations (the functions have the same name). So this is the reason for the different name (ksys_call). -- 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