aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/futex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-mips/futex.h')
-rw-r--r--include/asm-mips/futex.h33
1 files changed, 17 insertions, 16 deletions
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 12d118f1bc9..ed023eae067 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -3,7 +3,6 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/config.h>
7#include <linux/futex.h> 6#include <linux/futex.h>
8#include <asm/errno.h> 7#include <asm/errno.h>
9#include <asm/uaccess.h> 8#include <asm/uaccess.h>
@@ -22,51 +21,53 @@
22 " .set push \n" \ 21 " .set push \n" \
23 " .set noat \n" \ 22 " .set noat \n" \
24 " .set mips3 \n" \ 23 " .set mips3 \n" \
25 "1: ll %1, (%3) # __futex_atomic_op \n" \ 24 "1: ll %1, %4 # __futex_atomic_op \n" \
26 " .set mips0 \n" \ 25 " .set mips0 \n" \
27 " " insn " \n" \ 26 " " insn " \n" \
28 " .set mips3 \n" \ 27 " .set mips3 \n" \
29 "2: sc $1, (%3) \n" \ 28 "2: sc $1, %2 \n" \
30 " beqzl $1, 1b \n" \ 29 " beqzl $1, 1b \n" \
31 __FUTEX_SMP_SYNC \ 30 __FUTEX_SMP_SYNC \
32 "3: \n" \ 31 "3: \n" \
33 " .set pop \n" \ 32 " .set pop \n" \
34 " .set mips0 \n" \ 33 " .set mips0 \n" \
35 " .section .fixup,\"ax\" \n" \ 34 " .section .fixup,\"ax\" \n" \
36 "4: li %0, %5 \n" \ 35 "4: li %0, %6 \n" \
37 " j 2b \n" \ 36 " j 2b \n" \
38 " .previous \n" \ 37 " .previous \n" \
39 " .section __ex_table,\"a\" \n" \ 38 " .section __ex_table,\"a\" \n" \
40 " "__UA_ADDR "\t1b, 4b \n" \ 39 " "__UA_ADDR "\t1b, 4b \n" \
41 " "__UA_ADDR "\t2b, 4b \n" \ 40 " "__UA_ADDR "\t2b, 4b \n" \
42 " .previous \n" \ 41 " .previous \n" \
43 : "=r" (ret), "=r" (oldval) \ 42 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
44 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ 43 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
44 : "memory"); \
45 } else if (cpu_has_llsc) { \ 45 } else if (cpu_has_llsc) { \
46 __asm__ __volatile__( \ 46 __asm__ __volatile__( \
47 " .set push \n" \ 47 " .set push \n" \
48 " .set noat \n" \ 48 " .set noat \n" \
49 " .set mips3 \n" \ 49 " .set mips3 \n" \
50 "1: ll %1, (%3) # __futex_atomic_op \n" \ 50 "1: ll %1, %4 # __futex_atomic_op \n" \
51 " .set mips0 \n" \ 51 " .set mips0 \n" \
52 " " insn " \n" \ 52 " " insn " \n" \
53 " .set mips3 \n" \ 53 " .set mips3 \n" \
54 "2: sc $1, (%3) \n" \ 54 "2: sc $1, %2 \n" \
55 " beqz $1, 1b \n" \ 55 " beqz $1, 1b \n" \
56 __FUTEX_SMP_SYNC \ 56 __FUTEX_SMP_SYNC \
57 "3: \n" \ 57 "3: \n" \
58 " .set pop \n" \ 58 " .set pop \n" \
59 " .set mips0 \n" \ 59 " .set mips0 \n" \
60 " .section .fixup,\"ax\" \n" \ 60 " .section .fixup,\"ax\" \n" \
61 "4: li %0, %5 \n" \ 61 "4: li %0, %6 \n" \
62 " j 2b \n" \ 62 " j 2b \n" \
63 " .previous \n" \ 63 " .previous \n" \
64 " .section __ex_table,\"a\" \n" \ 64 " .section __ex_table,\"a\" \n" \
65 " "__UA_ADDR "\t1b, 4b \n" \ 65 " "__UA_ADDR "\t1b, 4b \n" \
66 " "__UA_ADDR "\t2b, 4b \n" \ 66 " "__UA_ADDR "\t2b, 4b \n" \
67 " .previous \n" \ 67 " .previous \n" \
68 : "=r" (ret), "=r" (oldval) \ 68 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
69 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ 69 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
70 : "memory"); \
70 } else \ 71 } else \
71 ret = -ENOSYS; \ 72 ret = -ENOSYS; \
72} 73}
@@ -89,23 +90,23 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
89 90
90 switch (op) { 91 switch (op) {
91 case FUTEX_OP_SET: 92 case FUTEX_OP_SET:
92 __futex_atomic_op("move $1, %z4", ret, oldval, uaddr, oparg); 93 __futex_atomic_op("move $1, %z5", ret, oldval, uaddr, oparg);
93 break; 94 break;
94 95
95 case FUTEX_OP_ADD: 96 case FUTEX_OP_ADD:
96 __futex_atomic_op("addu $1, %1, %z4", 97 __futex_atomic_op("addu $1, %1, %z5",
97 ret, oldval, uaddr, oparg); 98 ret, oldval, uaddr, oparg);
98 break; 99 break;
99 case FUTEX_OP_OR: 100 case FUTEX_OP_OR:
100 __futex_atomic_op("or $1, %1, %z4", 101 __futex_atomic_op("or $1, %1, %z5",
101 ret, oldval, uaddr, oparg); 102 ret, oldval, uaddr, oparg);
102 break; 103 break;
103 case FUTEX_OP_ANDN: 104 case FUTEX_OP_ANDN:
104 __futex_atomic_op("and $1, %1, %z4", 105 __futex_atomic_op("and $1, %1, %z5",
105 ret, oldval, uaddr, ~oparg); 106 ret, oldval, uaddr, ~oparg);
106 break; 107 break;
107 case FUTEX_OP_XOR: 108 case FUTEX_OP_XOR:
108 __futex_atomic_op("xor $1, %1, %z4", 109 __futex_atomic_op("xor $1, %1, %z5",
109 ret, oldval, uaddr, oparg); 110 ret, oldval, uaddr, oparg);
110 break; 111 break;
111 default: 112 default: