projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a28c6e
)
fix riscv64 syscall asm constraint
author
Rich Felker
<dalias@aerifal.cx>
Wed, 17 Jul 2019 22:50:15 +0000
(18:50 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 17 Jul 2019 22:50:15 +0000
(18:50 -0400)
having "+r"(a0) is redundant with "0"(a0) in syscalls with at least 1
arg, which is arguably a constraint violation (clang treats it as
such), and an invalid input with indeterminate value in the 0-arg
case. use the "=r"(a0) form instead.
arch/riscv64/syscall_arch.h
patch
|
blob
|
history
diff --git
a/arch/riscv64/syscall_arch.h
b/arch/riscv64/syscall_arch.h
index 1aaeb63138d59598d6c280b564bfdbe36d34693a..3e0804efe37fe8413081e54005e0d8638935f8a2 100644
(file)
--- a/
arch/riscv64/syscall_arch.h
+++ b/
arch/riscv64/syscall_arch.h
@@
-3,7
+3,7
@@
#define __asm_syscall(...) \
__asm__ __volatile__ ("ecall\n\t" \
- : "
+
r"(a0) : __VA_ARGS__ : "memory"); \
+ : "
=
r"(a0) : __VA_ARGS__ : "memory"); \
return a0; \
static inline long __syscall0(long n)