summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-03-11 18:58:38 -0400
committerRich Felker <dalias@aerifal.cx>2020-03-14 21:23:37 -0400
commitdb86ec100dc9973946ebfc9cf0d91686e334731a (patch)
treee183487decd18f3fd2cac3fce891230a791885ec /arch/mips
parent972b5fde9a2d1b5517c15803fb437195e6663085 (diff)
downloadmusl-db86ec100dc9973946ebfc9cf0d91686e334731a.tar.gz
remove useless mips syscall asm constraint, align style with mips64/n32
commit 4221f154ff29ab0d6be1e7beaa5ea2d1731bc58e added the r7 constraint apparently out of a misunderstanding of the breakage it was addressing, and did so because the asm was in a shared macro used by all the __syscallN inline functions. now "+r" is used in the output section for the forms 4-argument and up, so having it in input is redundant, and the forms with 0-3 arguments don't need it as an input at all. the r2 constraint is kept because without it most gcc versions (seems to be all prior to 9.x) fail to honor the output register binding for r2. this seems to be a variant of gcc bug #87733. both the r7 and r2 input constraints look useless, but the r2 one was a quiet workaround for gcc bug 87733, which affects all modern versions prior to 9.x, so it's kept and documented.
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/syscall_arch.h31
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/mips/syscall_arch.h b/arch/mips/syscall_arch.h
index a3812188..4286f00a 100644
--- a/arch/mips/syscall_arch.h
+++ b/arch/mips/syscall_arch.h
@@ -21,7 +21,8 @@ static inline long __syscall0(long n)
register long r2 __asm__("$2");
__asm__ __volatile__ (
"addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7)
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
@@ -33,8 +34,8 @@ static inline long __syscall1(long n, long a)
register long r2 __asm__("$2");
__asm__ __volatile__ (
"addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4)
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
@@ -47,8 +48,8 @@ static inline long __syscall2(long n, long a, long b)
register long r2 __asm__("$2");
__asm__ __volatile__ (
"addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5)
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
@@ -62,8 +63,8 @@ static inline long __syscall3(long n, long a, long b, long c)
register long r2 __asm__("$2");
__asm__ __volatile__ (
"addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5), "r"(r6)
+ : "=&r"(r2), "=r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
@@ -77,8 +78,8 @@ static inline long __syscall4(long n, long a, long b, long c, long d)
register long r2 __asm__("$2");
__asm__ __volatile__ (
"addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5), "r"(r6)
+ : "=&r"(r2), "+r"(r7)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
@@ -95,8 +96,8 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e)
"subu $sp,$sp,32 ; sw $8,16($sp) ; "
"addu $2,$0,%3 ; syscall ;"
"addu $sp,$sp,32"
- : "=&r"(r2), "=r"(r7), "+r"(r8)
- : "ir"(n), "0"(r2), "1"(r7), "r"(r4), "r"(r5), "r"(r6)
+ : "=&r"(r2), "+r"(r7), "+r"(r8)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$9", "$10");
return r7 ? -r2 : r2;
}
@@ -114,8 +115,8 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
"subu $sp,$sp,32 ; sw $8,16($sp) ; sw $9,20($sp) ; "
"addu $2,$0,%4 ; syscall ;"
"addu $sp,$sp,32"
- : "=&r"(r2), "=r"(r7), "+r"(r8), "+r"(r9)
- : "ir"(n), "0"(r2), "1"(r7), "r"(r4), "r"(r5), "r"(r6)
+ : "=&r"(r2), "+r"(r7), "+r"(r8), "+r"(r9)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$10");
return r7 ? -r2 : r2;
}
@@ -134,8 +135,8 @@ static inline long __syscall7(long n, long a, long b, long c, long d, long e, lo
"subu $sp,$sp,32 ; sw $8,16($sp) ; sw $9,20($sp) ; sw $10,24($sp) ; "
"addu $2,$0,%5 ; syscall ;"
"addu $sp,$sp,32"
- : "=&r"(r2), "=r"(r7), "+r"(r8), "+r"(r9), "+r"(r10)
- : "ir"(n), "0"(r2), "1"(r7), "r"(r4), "r"(r5), "r"(r6)
+ : "=&r"(r2), "+r"(r7), "+r"(r8), "+r"(r9), "+r"(r10)
+ : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST);
return r7 ? -r2 : r2;
}