diff --git a/arch/mips64/syscall_arch.h b/arch/mips64/syscall_arch.h index a653c31c6ed54f2b8bfd40cc4e924efeddc9c6c1..1e720c7d801b3d049b2d9b9c36eab35b301cb9e8 100644 --- a/arch/mips64/syscall_arch.h +++ b/arch/mips64/syscall_arch.h @@ -53,10 +53,11 @@ static void __stat_fix(struct kernel_stat *kst, struct stat *st) static inline long __syscall0(long n) { register long r7 __asm__("$7"); - register long r2 __asm__("$2"); + register long r2 __asm__("$2") = n; __asm__ __volatile__ ( - "daddu $2,$0,%2 ; syscall" - : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7) + "syscall" + : "+&r"(r2), "=r"(r7) + : : SYSCALL_CLOBBERLIST); return r7 ? -r2 : r2; } @@ -65,11 +66,11 @@ static inline long __syscall1(long n, long a) { register long r4 __asm__("$4") = a; register long r7 __asm__("$7"); - register long r2 __asm__("$2"); + register long r2 __asm__("$2") = n; __asm__ __volatile__ ( - "daddu $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); return r7 ? -r2 : r2; } @@ -81,15 +82,15 @@ static inline long __syscall2(long n, long a, long b) 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; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; __asm__ __volatile__ ( - "daddu $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); if (r7) return -r2; @@ -109,15 +110,15 @@ static inline long __syscall3(long n, long a, long b, long c) 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; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; __asm__ __volatile__ ( - "daddu $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); if (r7) return -r2; @@ -137,7 +138,7 @@ static inline long __syscall4(long n, long a, long b, long c, long d) 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; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; @@ -145,9 +146,9 @@ static inline long __syscall4(long n, long a, long b, long c, long d) r6 = (long) &kst; __asm__ __volatile__ ( - "daddu $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); if (r7) return -r2; @@ -170,7 +171,7 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e) 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; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; @@ -178,9 +179,9 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e) r6 = (long) &kst; __asm__ __volatile__ ( - "daddu $2,$0,%2 ; syscall" - : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), - "r"(r4), "r"(r5), "r"(r6), "r"(r8) + "syscall" + : "+&r"(r2), "+r"(r7) + : "r"(r4), "r"(r5), "r"(r6), "r"(r8) : SYSCALL_CLOBBERLIST); if (r7) return -r2; @@ -204,7 +205,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo 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; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; @@ -212,9 +213,9 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo r6 = (long) &kst; __asm__ __volatile__ ( - "daddu $2,$0,%2 ; syscall" - : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), - "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9) + "syscall" + : "+&r"(r2), "+r"(r7) + : "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9) : SYSCALL_CLOBBERLIST); if (r7) return -r2; diff --git a/arch/mipsn32/syscall_arch.h b/arch/mipsn32/syscall_arch.h index 90823a99ce5dfced5c39158bb8989cd60b55fd1e..894c033d84f6c8ce1fae97f972fc0984eecb7868 100644 --- a/arch/mipsn32/syscall_arch.h +++ b/arch/mipsn32/syscall_arch.h @@ -22,10 +22,11 @@ static inline void __stat_fix(long p) 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); return r7 ? -r2 : r2; } @@ -34,11 +35,11 @@ static inline long __syscall1(long n, long a) { 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); return r7 ? -r2 : r2; } @@ -48,11 +49,11 @@ static inline long __syscall2(long n, long a, long b) 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); if (r7) return -r2; long ret = r2; @@ -66,11 +67,11 @@ static inline long __syscall3(long n, long a, long b, long c) 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); if (r7) return -r2; long ret = r2; @@ -84,11 +85,11 @@ static inline long __syscall4(long n, long a, long b, long c, long d) 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); if (r7) return -r2; long ret = r2; @@ -104,11 +105,11 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e) 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__ ( - "addu $2,$0,%2 ; syscall" - : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), - "r"(r4), "r"(r5), "r"(r6), "r"(r8) + "syscall" + : "+&r"(r2), "+r"(r7) + : "r"(r4), "r"(r5), "r"(r6), "r"(r8) : SYSCALL_CLOBBERLIST); if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); if (n == SYS_newfstatat) __stat_fix(c); @@ -123,11 +124,11 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo 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__ ( - "addu $2,$0,%2 ; syscall" - : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), - "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9) + "syscall" + : "+&r"(r2), "+r"(r7) + : "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9) : SYSCALL_CLOBBERLIST); if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) __stat_fix(b); if (n == SYS_newfstatat) __stat_fix(c);