1 #ifndef _ASM_GENERIC_FUTEX_H
2 #define _ASM_GENERIC_FUTEX_H
4 #include <linux/futex.h>
5 #include <linux/uaccess.h>
9 futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
11 int op = (encoded_op >> 28) & 7;
12 int cmp = (encoded_op >> 24) & 15;
13 int oparg = (encoded_op << 8) >> 20;
14 int cmparg = (encoded_op << 20) >> 20;
16 if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28))
19 if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int)))
38 case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break;
39 case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break;
40 case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break;
41 case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break;
42 case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break;
43 case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break;
44 default: ret = -ENOSYS;
51 futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)