about summary refs log tree commit diff
path: root/arch/mips64/syscall_arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips64/syscall_arch.h')
-rw-r--r--arch/mips64/syscall_arch.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/mips64/syscall_arch.h b/arch/mips64/syscall_arch.h
index d34efdc0..ae6532fc 100644
--- a/arch/mips64/syscall_arch.h
+++ b/arch/mips64/syscall_arch.h
@@ -22,7 +22,7 @@ static inline long __syscall0(long n)
 		: "=&r"(r2), "=r"(r7)
 		: "ir"(n), "0"(r2)
 		: SYSCALL_CLOBBERLIST);
-	return r7 ? -r2 : r2;
+	return r7 && r2>0 ? -r2 : r2;
 }
 
 static inline long __syscall1(long n, long a)
@@ -35,7 +35,7 @@ static inline long __syscall1(long n, long a)
 		: "=&r"(r2), "=r"(r7)
 		: "ir"(n), "0"(r2), "r"(r4)
 		: SYSCALL_CLOBBERLIST);
-	return r7 ? -r2 : r2;
+	return r7 && r2>0 ? -r2 : r2;
 }
 
 static inline long __syscall2(long n, long a, long b)
@@ -50,7 +50,7 @@ static inline long __syscall2(long n, long a, long b)
 		: "=&r"(r2), "=r"(r7)
 		: "ir"(n), "0"(r2), "r"(r4), "r"(r5)
 		: SYSCALL_CLOBBERLIST);
-	return r7 ? -r2 : r2;
+	return r7 && r2>0 ? -r2 : r2;
 }
 
 static inline long __syscall3(long n, long a, long b, long c)
@@ -66,7 +66,7 @@ static inline long __syscall3(long n, long a, long b, long c)
 		: "=&r"(r2), "=r"(r7)
 		: "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
 		: SYSCALL_CLOBBERLIST);
-	return r7 ? -r2 : r2;
+	return r7 && r2>0 ? -r2 : r2;
 }
 
 static inline long __syscall4(long n, long a, long b, long c, long d)
@@ -82,7 +82,7 @@ static inline long __syscall4(long n, long a, long b, long c, long d)
 		: "=&r"(r2), "+r"(r7)
 		: "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
 		: SYSCALL_CLOBBERLIST);
-	return r7 ? -r2 : r2;
+	return r7 && r2>0 ? -r2 : r2;
 }
 
 static inline long __syscall5(long n, long a, long b, long c, long d, long e)
@@ -99,7 +99,7 @@ static inline long __syscall5(long n, long a, long b, long c, long d, long e)
 		: "=&r"(r2), "+r"(r7)
 		: "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8)
 		: SYSCALL_CLOBBERLIST);
-	return r7 ? -r2 : r2;
+	return r7 && r2>0 ? -r2 : r2;
 }
 
 static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
@@ -117,7 +117,7 @@ static inline long __syscall6(long n, long a, long b, long c, long d, long e, lo
 		: "=&r"(r2), "+r"(r7)
 		: "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9)
 		: SYSCALL_CLOBBERLIST);
-	return r7 ? -r2 : r2;
+	return r7 && r2>0 ? -r2 : r2;
 }
 
 #define VDSO_USEFUL