extinguish commented on code in PR #14887:
URL: https://github.com/apache/nuttx/pull/14887#discussion_r1851584962


##########
arch/arm/src/armv6-m/arm_svcall.c:
##########
@@ -92,7 +92,7 @@ static void dispatch_syscall(void)
     " ldr r4, =g_stublookup\n"                      /* R4=The base of the stub 
lookup table */
     " lsl r0, r0, #2\n"                             /* R0=Offset of the stub 
for this syscall */
     " ldr r4, [r4, r0]\n"                           /* R4=Address of the stub 
for this syscall */
-    " blx r5\n"                                     /* Call the stub (modifies 
lr) */
+    " blx r4\n"                                     /* Call the stub (modifies 
lr) */

Review Comment:
   > how about other m arch?
   
   other arch do not have this issue, the following is the implementation in 
armv7-m/armv8-m/armv7-a/armv7-r:
   ```
         " ldr ip, =g_stublookup\n"                      /* R12=The base of the 
stub lookup table */
         " ldr ip, [ip, r0, lsl #2]\n"                   /* R12=The address of 
the stub for this syscall */
         " blx ip\n"                                     /* Call the stub 
(modifies lr) */
   ```
   which correct handling the sub-routine calling procedure
   
   and in arm64, the implementation is using inline asm code, also do not have 
such issue



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