1 #ifndef _ASM_M68K_FUTEX_H
2 #define _ASM_M68K_FUTEX_H
5 #if !defined(CONFIG_MMU)
6 #include <asm-generic/futex.h>
9 #include <linux/futex.h>
10 #include <linux/uaccess.h>
11 #include <asm/errno.h>
14 futex_atomic_cmpxchg_inatomic(u32
*uval
, u32 __user
*uaddr
,
15 u32 oldval
, u32 newval
)
19 if (unlikely(get_user(val
, uaddr
) != 0))
22 if (val
== oldval
&& unlikely(put_user(newval
, uaddr
) != 0))
31 futex_atomic_op_inuser(int encoded_op
, u32 __user
*uaddr
)
33 int op
= (encoded_op
>> 28) & 7;
34 int cmp
= (encoded_op
>> 24) & 15;
35 int oparg
= (encoded_op
<< 8) >> 20;
36 int cmparg
= (encoded_op
<< 20) >> 20;
40 if (encoded_op
& (FUTEX_OP_OPARG_SHIFT
<< 28))
43 pagefault_disable(); /* implies preempt_disable() */
46 if (unlikely(get_user(oldval
, uaddr
) != 0))
47 goto out_pagefault_enable
;
72 if (ret
== 0 && unlikely(put_user(tmp
, uaddr
) != 0))
76 pagefault_enable(); /* subsumes preempt_enable() */
80 case FUTEX_OP_CMP_EQ
: ret
= (oldval
== cmparg
); break;
81 case FUTEX_OP_CMP_NE
: ret
= (oldval
!= cmparg
); break;
82 case FUTEX_OP_CMP_LT
: ret
= (oldval
< cmparg
); break;
83 case FUTEX_OP_CMP_GE
: ret
= (oldval
>= cmparg
); break;
84 case FUTEX_OP_CMP_LE
: ret
= (oldval
<= cmparg
); break;
85 case FUTEX_OP_CMP_GT
: ret
= (oldval
> cmparg
); break;
86 default: ret
= -ENOSYS
;
92 #endif /* CONFIG_MMU */
93 #endif /* __KERNEL__ */
94 #endif /* _ASM_M68K_FUTEX_H */