• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
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  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_LINUX_FUTEX_H
20 #define _UAPI_LINUX_FUTEX_H
21 #include <linux/compiler.h>
22 #include <linux/types.h>
23 #define FUTEX_WAIT 0
24 #define FUTEX_WAKE 1
25 #define FUTEX_FD 2
26 #define FUTEX_REQUEUE 3
27 #define FUTEX_CMP_REQUEUE 4
28 #define FUTEX_WAKE_OP 5
29 #define FUTEX_LOCK_PI 6
30 #define FUTEX_UNLOCK_PI 7
31 #define FUTEX_TRYLOCK_PI 8
32 #define FUTEX_WAIT_BITSET 9
33 #define FUTEX_WAKE_BITSET 10
34 #define FUTEX_WAIT_REQUEUE_PI 11
35 #define FUTEX_CMP_REQUEUE_PI 12
36 #define FUTEX_LOCK_PI2 13
37 #define FUTEX_PRIVATE_FLAG 128
38 #define FUTEX_CLOCK_REALTIME 256
39 #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
40 #define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
41 #define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
42 #define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
43 #define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
44 #define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
45 #define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
46 #define FUTEX_LOCK_PI2_PRIVATE (FUTEX_LOCK_PI2 | FUTEX_PRIVATE_FLAG)
47 #define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
48 #define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
49 #define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
50 #define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
51 #define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
52 #define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
53 #define FUTEX_32 2
54 #define FUTEX_WAITV_MAX 128
55 struct futex_waitv {
56   __u64 val;
57   __u64 uaddr;
58   __u32 flags;
59   __u32 __reserved;
60 };
61 struct robust_list {
62   struct robust_list  * next;
63 };
64 struct robust_list_head {
65   struct robust_list list;
66   long futex_offset;
67   struct robust_list  * list_op_pending;
68 };
69 #define FUTEX_WAITERS 0x80000000
70 #define FUTEX_OWNER_DIED 0x40000000
71 #define FUTEX_TID_MASK 0x3fffffff
72 #define ROBUST_LIST_LIMIT 2048
73 #define FUTEX_BITSET_MATCH_ANY 0xffffffff
74 #define FUTEX_OP_SET 0
75 #define FUTEX_OP_ADD 1
76 #define FUTEX_OP_OR 2
77 #define FUTEX_OP_ANDN 3
78 #define FUTEX_OP_XOR 4
79 #define FUTEX_OP_OPARG_SHIFT 8
80 #define FUTEX_OP_CMP_EQ 0
81 #define FUTEX_OP_CMP_NE 1
82 #define FUTEX_OP_CMP_LT 2
83 #define FUTEX_OP_CMP_LE 3
84 #define FUTEX_OP_CMP_GT 4
85 #define FUTEX_OP_CMP_GE 5
86 #define FUTEX_OP(op,oparg,cmp,cmparg) (((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
87 #endif
88