armv6-m: fix the incorrect stub-function entry address of svc call

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>
This commit is contained in:
guoshichao
2024-11-21 14:42:25 +08:00
committed by Xiang Xiao
parent 58f226d2b5
commit f6cfcfa39f
+1 -1
View File
@@ -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 */