static inline long __syscall0(long n)
{
register long r7 __asm__("$7");
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7)
+ "syscall"
+ : "+r"(r2), "=r"(r7)
+ :
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
{
register long r4 __asm__("$4") = a;
register long r7 __asm__("$7");
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4)
+ "syscall"
+ : "+r"(r2), "=r"(r7)
+ : "r"(r4)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
register long r4 __asm__("$4") = a;
register long r5 __asm__("$5") = b;
register long r7 __asm__("$7");
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5)
+ "syscall"
+ : "+r"(r2), "=r"(r7)
+ : "r"(r4), "r"(r5)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
register long r5 __asm__("$5") = b;
register long r6 __asm__("$6") = c;
register long r7 __asm__("$7");
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5), "r"(r6)
+ "syscall"
+ : "+r"(r2), "=r"(r7)
+ : "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
register long r5 __asm__("$5") = b;
register long r6 __asm__("$6") = c;
register long r7 __asm__("$7") = d;
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
- "addu $2,$0,%2 ; syscall"
- : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7),
- "r"(r4), "r"(r5), "r"(r6)
+ "syscall"
+ : "+r"(r2), "+r"(r7)
+ : "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
return r7 ? -r2 : r2;
}
register long r6 __asm__("$6") = c;
register long r7 __asm__("$7") = d;
register long r8 __asm__("$8") = e;
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
"subu $sp,$sp,32 ; sw $8,16($sp) ; "
- "addu $2,$0,%3 ; syscall ;"
+ "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)
+ : "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$9", "$10");
return r7 ? -r2 : r2;
}
register long r7 __asm__("$7") = d;
register long r8 __asm__("$8") = e;
register long r9 __asm__("$9") = f;
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
"subu $sp,$sp,32 ; sw $8,16($sp) ; sw $9,20($sp) ; "
- "addu $2,$0,%4 ; syscall ;"
+ "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)
+ : "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST, "$10");
return r7 ? -r2 : r2;
}
register long r8 __asm__("$8") = e;
register long r9 __asm__("$9") = f;
register long r10 __asm__("$10") = g;
- register long r2 __asm__("$2");
+ register long r2 __asm__("$2") = n;
__asm__ __volatile__ (
"subu $sp,$sp,32 ; sw $8,16($sp) ; sw $9,20($sp) ; sw $10,24($sp) ; "
- "addu $2,$0,%5 ; syscall ;"
+ "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)
+ : "r"(r4), "r"(r5), "r"(r6)
: SYSCALL_CLOBBERLIST);
return r7 ? -r2 : r2;
}