pussuw commented on a change in pull request #5782:
URL: https://github.com/apache/incubator-nuttx/pull/5782#discussion_r837793702



##########
File path: arch/risc-v/src/common/riscv_swint.c
##########
@@ -144,7 +148,11 @@ static void dispatch_syscall(void)
      " addi sp, sp, 4\n"          /* Destroy the stack frame */
      " mv   a2, a0\n"             /* a2=Save return value in a0 */
      " li   a0, 3\n"              /* a0=SYS_syscall_return (3) */
+#ifdef CONFIG_ARCH_USE_S_MODE

Review comment:
       I considered this already and it's not that easy, note that the 
store/load instructions are also different:
   
   " sd ra, 0(sp)\n" /* Save ra in the stack frame */
   vs 
   " sw ra, 0(sp)\n" /* Save ra in the stack frame */
   
   There are macros for those, but embedding the macros into this code is not 
simple.
   
   Also, this is how the implementation was so I did not modify it too much.




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


Reply via email to