10 #include <linux/errno.h>
13 #include <asm/futex.h>
32 unsigned long tmp1, tmp2;
36 "0: mvcp 0(%0,%2),0(%1),%3\n"
41 "2: mvcp 0(%0,%2),0(%1),%3\n"
50 "4: mvcp 0(%4,%2),0(%1),%3\n"
57 "6: xc 0(256,%2),0(%2)\n"
67 :
"+a" (
size),
"+a" (ptr),
"+a" (
x),
"+a" (tmp1),
"=a" (tmp2)
72 static size_t copy_from_user_std_check(
size_t size,
const void __user *
ptr,
82 unsigned long tmp1, tmp2;
86 "0: mvcs 0(%0,%1),0(%2),%3\n"
91 "2: mvcs 0(%0,%1),0(%2),%3\n"
100 "4: mvcs 0(%4,%1),0(%2),%3\n"
107 :
"+a" (
size),
"+a" (ptr),
"+a" (
x),
"+a" (tmp1),
"=a" (tmp2)
112 static size_t copy_to_user_std_check(
size_t size,
void __user *ptr,
120 static size_t copy_in_user_std(
size_t size,
void __user *to,
121 const void __user *
from)
131 "1: mvc 0(1,%1),0(%2)\n"
137 "2: mvc 0(256,%1),0(%2)\n"
142 "4: ex %0,1b-0b(%3)\n"
146 : "+
a" (size), "+
a" (to), "+
a" (from), "=
a" (tmp1)
151 static
size_t clear_user_std(
size_t size,
void __user *to)
153 unsigned long tmp1, tmp2;
160 " xc 0(1,%1),0(%1)\n"
173 "2: xc 0(256,%1),0(%1)\n"
181 : "+
a" (size), "+
a" (to), "=
a" (tmp1), "=
a" (tmp2)
188 register unsigned long reg0 asm(
"0") = 0
UL;
189 unsigned long tmp1, tmp2;
202 :
"+a" (
size),
"+a" (src),
"=a" (
tmp1),
"=a" (tmp2)
203 :
"d" (
reg0) :
"cc",
"memory");
209 register unsigned long reg0 asm(
"0") = 0
UL;
210 unsigned long tmp1, tmp2;
224 "2: mvcp 0(%4,%2),0(%1),%5\n"
229 "4: mvcp 0(%4,%2),0(%1),%5\n"
236 :
"+a" (
size),
"+a" (src),
"+d" (
dst),
"=a" (tmp1),
"=a" (tmp2)
237 :
"d" (
reg0),
"K" (-
EFAULT) :
"cc",
"memory");
241 #define __futex_atomic_op(insn, ret, oldval, newval, uaddr, oparg) \
246 "2: cs %1,%2,0(%6)\n" \
250 EX_TABLE(0b,4b) EX_TABLE(2b,4b) EX_TABLE(3b,4b) \
251 : "=d" (ret), "=&d" (oldval), "=&d" (newval), \
253 : "0" (-EFAULT), "d" (oparg), "a" (uaddr), \
254 "m" (*uaddr) : "cc");
258 int oldval = 0, newval,
ret;
263 ret, oldval, newval, uaddr, oparg);
267 ret, oldval, newval, uaddr, oparg);
271 ret, oldval, newval, uaddr, oparg);
275 ret, oldval, newval, uaddr, oparg);
279 ret, oldval, newval, uaddr, oparg);
295 "0: cs %1,%4,0(%5)\n"
299 :
"=d" (
ret),
"+d" (oldval),
"=m" (*uaddr)
300 :
"0" (-
EFAULT),
"d" (newval),
"a" (
uaddr),
"m" (*uaddr)
307 .copy_from_user = copy_from_user_std_check,
309 .copy_to_user = copy_to_user_std_check,
311 .copy_in_user = copy_in_user_std,
312 .clear_user = clear_user_std,