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



##########
File path: arch/risc-v/include/syscall.h
##########
@@ -207,7 +162,15 @@ static inline uintptr_t sys_call0(unsigned int nbr)
 
   asm volatile
     (
+#if defined (CONFIG_ARCH_USE_S_MODE) && defined (__KERNEL__)
+     " addi sp, sp, -16\n"                  /* Make room */
+     " sd   ra, 0(sp)\n"                    /* Save ra */

Review comment:
       I think we need to move such things to 
`arch/risc-v/src/common/riscv_internal.h` and have something like
   ```
   #ifndef __ASSEMBLY__
   #. define _STR(s)        #s
   #else
   #. define _STR(s)        s
   #endif
   
   #define _XSTR(s)       _STR(s)
   
   #if defined(CONFIG_ARCH_QPFPU)
   #  define FLOAD     _XSTR(flq)
   #  define FSTORE    _XSTR(fsq)
   #elif defined(CONFIG_ARCH_DPFPU)
   #  define FLOAD     _XSTR(fld)
   #  define FSTORE    _XSTR(fsd)
   #else
   #  define FLOAD     _XSTR(flw)
   #  define FSTORE    _XSTR(fsw)
   #endif
   
   #ifdef CONFIG_ARCH_RV32
   #  define REGLOAD   _XSTR(lw)
   #  define REGSTORE  _XSTR(sw)
   #else
   #  define REGLOAD   _XSTR(ld)
   #  define REGSTORE  _XSTR(sd)
   #endif
   ```




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