Skip to content

Commit 1badf77

Browse files
galakioannisg
authored andcommitted
arch: arm: aarch32: Fix syscall inline asm
The inline asm code was not conveying in all cases that registers r1-r3 would get clobbered by the SVC handler code. In the cases that we can't list r1-r3 in the clobber list the registers need to show up as outputs to know that they values are not preserved by the callee. Fixes #30393 Signed-off-by: Kumar Gala <[email protected]>
1 parent d382868 commit 1badf77

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/arch/arm/aarch32/syscall.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static inline uintptr_t arch_syscall_invoke6(uintptr_t arg1, uintptr_t arg2,
5050
register uint32_t r6 __asm__("r6") = call_id;
5151

5252
__asm__ volatile("svc %[svid]\n"
53-
: "=r"(ret)
53+
: "=r"(ret), "=r"(r1), "=r"(r2), "=r"(r3)
5454
: [svid] "i" (_SVC_CALL_SYSTEM_CALL),
5555
"r" (ret), "r" (r1), "r" (r2), "r" (r3),
5656
"r" (r4), "r" (r5), "r" (r6)
@@ -72,7 +72,7 @@ static inline uintptr_t arch_syscall_invoke5(uintptr_t arg1, uintptr_t arg2,
7272
register uint32_t r6 __asm__("r6") = call_id;
7373

7474
__asm__ volatile("svc %[svid]\n"
75-
: "=r"(ret)
75+
: "=r"(ret), "=r"(r1), "=r"(r2), "=r"(r3)
7676
: [svid] "i" (_SVC_CALL_SYSTEM_CALL),
7777
"r" (ret), "r" (r1), "r" (r2), "r" (r3),
7878
"r" (r4), "r" (r6)
@@ -92,7 +92,7 @@ static inline uintptr_t arch_syscall_invoke4(uintptr_t arg1, uintptr_t arg2,
9292
register uint32_t r6 __asm__("r6") = call_id;
9393

9494
__asm__ volatile("svc %[svid]\n"
95-
: "=r"(ret)
95+
: "=r"(ret), "=r"(r1), "=r"(r2), "=r"(r3)
9696
: [svid] "i" (_SVC_CALL_SYSTEM_CALL),
9797
"r" (ret), "r" (r1), "r" (r2), "r" (r3),
9898
"r" (r6)
@@ -111,7 +111,7 @@ static inline uintptr_t arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2,
111111
register uint32_t r6 __asm__("r6") = call_id;
112112

113113
__asm__ volatile("svc %[svid]\n"
114-
: "=r"(ret)
114+
: "=r"(ret), "=r"(r1), "=r"(r2)
115115
: [svid] "i" (_SVC_CALL_SYSTEM_CALL),
116116
"r" (ret), "r" (r1), "r" (r2), "r" (r6)
117117
: "r8", "memory", "r3", "ip");
@@ -127,7 +127,7 @@ static inline uintptr_t arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2,
127127
register uint32_t r6 __asm__("r6") = call_id;
128128

129129
__asm__ volatile("svc %[svid]\n"
130-
: "=r"(ret)
130+
: "=r"(ret), "=r"(r1)
131131
: [svid] "i" (_SVC_CALL_SYSTEM_CALL),
132132
"r" (ret), "r" (r1), "r" (r6)
133133
: "r8", "memory", "r2", "r3", "ip");

0 commit comments

Comments
 (0)