diff options
author | Rich Felker <dalias@aerifal.cx> | 2019-04-10 19:45:17 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2019-04-10 19:56:08 -0400 |
commit | d3b4869cd3a1861f824b9a97c3078846748764f0 (patch) | |
tree | 504bacff8b282f63d794894bb88a48d81fd3f4ad | |
parent | dcb18bea6159e841b8c894ac606f471882513429 (diff) | |
download | musl-d3b4869cd3a1861f824b9a97c3078846748764f0.zip musl-d3b4869cd3a1861f824b9a97c3078846748764f0.tar.gz musl-d3b4869cd3a1861f824b9a97c3078846748764f0.tar.bz2 |
cleanup mips64 syscall_arch functions
-rw-r--r-- | arch/mips64/syscall_arch.h | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/arch/mips64/syscall_arch.h b/arch/mips64/syscall_arch.h index 5eabdf4..28d0f93 100644 --- a/arch/mips64/syscall_arch.h +++ b/arch/mips64/syscall_arch.h @@ -79,16 +79,14 @@ static inline long __syscall2(long n, long a, long b) { struct kernel_stat kst; long ret; - register long r4 __asm__("$4"); - register long r5 __asm__("$5"); + register long r4 __asm__("$4") = a; + register long r5 __asm__("$5") = b; register long r7 __asm__("$7"); register long r2 __asm__("$2"); - r5 = b; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; - r4 = a; __asm__ __volatile__ ( "daddu $2,$0,%2 ; syscall" : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), @@ -109,18 +107,15 @@ static inline long __syscall3(long n, long a, long b, long c) { struct kernel_stat kst; long ret; - register long r4 __asm__("$4"); - register long r5 __asm__("$5"); - register long r6 __asm__("$6"); + register long r4 __asm__("$4") = a; + register long r5 __asm__("$5") = b; + register long r6 __asm__("$6") = c; register long r7 __asm__("$7"); register long r2 __asm__("$2"); - r5 = b; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; - r4 = a; - r6 = c; __asm__ __volatile__ ( "daddu $2,$0,%2 ; syscall" : "=&r"(r2), "=r"(r7) : "ir"(n), "0"(r2), "1"(r7), @@ -141,16 +136,12 @@ static inline long __syscall4(long n, long a, long b, long c, long d) { struct kernel_stat kst; long ret; - register long r4 __asm__("$4"); - register long r5 __asm__("$5"); - register long r6 __asm__("$6"); - register long r7 __asm__("$7"); + register long r4 __asm__("$4") = a; + register long r5 __asm__("$5") = b; + register long r6 __asm__("$6") = c; + register long r7 __asm__("$7") = d; register long r2 __asm__("$2"); - r4 = a; - r5 = b; - r6 = c; - r7 = d; if (n == SYS_stat || n == SYS_fstat || n == SYS_lstat) r5 = (long) &kst; if (n == SYS_newfstatat) |