pussuw commented on a change in pull request #5782: URL: https://github.com/apache/incubator-nuttx/pull/5782#discussion_r837112182
########## File path: arch/risc-v/src/common/riscv_internal.h ########## @@ -279,6 +288,63 @@ int riscv_pause_handler(int irq, void *c, void *arg); uintptr_t riscv_mhartid(void); +#ifdef CONFIG_ARCH_USE_S_MODE +/* If kernel runs in Supervisor mode, declare proper function prototypes, + * this is because it is not possible to ecall from S mode to S mode + */ + +int riscv_saveusercontext(uintptr_t *saveregs); +void riscv_fullcontextrestore(uintptr_t *restoreregs) noreturn_function; +void riscv_switchcontext(uintptr_t *saveregs, uintptr_t *restoreregs); +void riscv_syscall_return(void); +void riscv_syscall_dispatch(void) noreturn_function; + +#else + +#ifndef __ASSEMBLY__ Review comment: Sure, I agree on that 100%. I'll remove the test here, just need to be careful if this file is modified or if these macros are moved elsewhere. -- 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