blob: 30f9e590db9d5b6b09247f8255ee716ae4bb4f31 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_FUTEX_H
13#define _LINUX_FUTEX_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080015#include <linux/sched.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080016
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017#define FUTEX_WAIT 0
18#define FUTEX_WAKE 1
19#define FUTEX_FD 2
20#define FUTEX_REQUEUE 3
21#define FUTEX_CMP_REQUEUE 4
22#define FUTEX_WAKE_OP 5
23#define FUTEX_LOCK_PI 6
24#define FUTEX_UNLOCK_PI 7
25#define FUTEX_TRYLOCK_PI 8
Ben Cheng4b29af02012-03-07 16:14:53 -080026
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080027struct robust_list {
28 struct robust_list __user *next;
29};
Ben Cheng4b29af02012-03-07 16:14:53 -080030
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080031struct robust_list_head {
Ben Cheng4b29af02012-03-07 16:14:53 -080032
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080033 struct robust_list list;
Ben Cheng4b29af02012-03-07 16:14:53 -080034
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035 long futex_offset;
Ben Cheng4b29af02012-03-07 16:14:53 -080036
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080037 struct robust_list __user *list_op_pending;
38};
Ben Cheng4b29af02012-03-07 16:14:53 -080039
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080040#define FUTEX_WAITERS 0x80000000
Ben Cheng4b29af02012-03-07 16:14:53 -080041
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080042#define FUTEX_OWNER_DIED 0x40000000
Ben Cheng4b29af02012-03-07 16:14:53 -080043
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#define FUTEX_TID_MASK 0x3fffffff
Ben Cheng4b29af02012-03-07 16:14:53 -080045
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080046#define ROBUST_LIST_LIMIT 2048
Ben Cheng4b29af02012-03-07 16:14:53 -080047
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080048#define FUTEX_OP_SET 0
49#define FUTEX_OP_ADD 1
50#define FUTEX_OP_OR 2
51#define FUTEX_OP_ANDN 3
52#define FUTEX_OP_XOR 4
53#define FUTEX_OP_OPARG_SHIFT 8
54#define FUTEX_OP_CMP_EQ 0
55#define FUTEX_OP_CMP_NE 1
56#define FUTEX_OP_CMP_LT 2
57#define FUTEX_OP_CMP_LE 3
58#define FUTEX_OP_CMP_GT 4
59#define FUTEX_OP_CMP_GE 5
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080060#define FUTEX_OP(op, oparg, cmp, cmparg) (((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
61#endif