Skip to content

Commit

Permalink
armv6-m: fix the incorrect stub-function entry address of svc call
Browse files Browse the repository at this point in the history
the stub-function entry address is stored in r4, we should branch to the
stub-function with blx r4, not r5

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
  • Loading branch information
extinguish committed Dec 24, 2024
1 parent 6761043 commit aa540a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/src/armv6-m/arm_svcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
" mov lr, r5\n" /* Restore lr */
" add sp, sp, #12\n" /* Destroy the stack frame */
" pop {r4, r5}\n" /* Recover R4 and R5 */
Expand Down

0 comments on commit aa540a8

Please sign in to comment.