pussuw commented on code in PR #12812:
URL: https://github.com/apache/nuttx/pull/12812#discussion_r1701756006


##########
arch/risc-v/src/common/riscv_swint.c:
##########
@@ -48,16 +48,61 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifdef CONFIG_LIB_SYSCALL
-#  define TCB_FLAGS_OFFSET offsetof(struct tcb_s, flags)
-#endif
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
 
 #ifdef CONFIG_LIB_SYSCALL
 
+/****************************************************************************
+ * Name: do_syscall
+ *
+ * Description:
+ *   Call the stub function corresponding to the system call.  NOTE the non-
+ *   standard parameter passing:
+ *
+ *     A0 = SYS_ call number
+ *     A1 = parm0
+ *     A2 = parm1
+ *     A3 = parm2
+ *     A4 = parm3
+ *     A5 = parm4
+ *     A6 = parm5
+ *
+ ****************************************************************************/
+
+uintptr_t do_syscall(unsigned int nbr, uintptr_t parm1,

Review Comment:
   As I suspected, the compiler uses a7 as a local variable but does not 
understand it can get clobbered by the system call (it doesn't understand the 
inlined assembly code does a jump..). What a pain.
   
   I'll add noinline_function and see if that fixes the issue. 
   
   EDIT: It does.



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

Reply via email to