blob: 6176f387e771167bf1f331414cdd3b6fe570ba34 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define FUTEX_WAIT 0
24#define FUTEX_WAKE 1
25#define FUTEX_FD 2
26#define FUTEX_REQUEUE 3
Ben Cheng655a7c02013-10-16 16:09:24 -070027#define FUTEX_CMP_REQUEUE 4
28#define FUTEX_WAKE_OP 5
29#define FUTEX_LOCK_PI 6
30#define FUTEX_UNLOCK_PI 7
Ben Cheng655a7c02013-10-16 16:09:24 -070031#define FUTEX_TRYLOCK_PI 8
32#define FUTEX_WAIT_BITSET 9
33#define FUTEX_WAKE_BITSET 10
34#define FUTEX_WAIT_REQUEUE_PI 11
Ben Cheng655a7c02013-10-16 16:09:24 -070035#define FUTEX_CMP_REQUEUE_PI 12
36#define FUTEX_PRIVATE_FLAG 128
37#define FUTEX_CLOCK_REALTIME 256
38#define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
Ben Cheng655a7c02013-10-16 16:09:24 -070039#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
40#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
41#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
42#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
44#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
45#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
46#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)
48#define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)
Tao Baod7db5942015-01-28 10:07:51 -080049#define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
50#define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
Ben Cheng655a7c02013-10-16 16:09:24 -070051struct robust_list {
Tao Baod7db5942015-01-28 10:07:51 -080052 struct robust_list __user * next;
Ben Cheng655a7c02013-10-16 16:09:24 -070053};
54struct robust_list_head {
Tao Baod7db5942015-01-28 10:07:51 -080055 struct robust_list list;
56 long futex_offset;
57 struct robust_list __user * list_op_pending;
Ben Cheng655a7c02013-10-16 16:09:24 -070058};
Ben Cheng655a7c02013-10-16 16:09:24 -070059#define FUTEX_WAITERS 0x80000000
60#define FUTEX_OWNER_DIED 0x40000000
61#define FUTEX_TID_MASK 0x3fffffff
62#define ROBUST_LIST_LIMIT 2048
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define FUTEX_BITSET_MATCH_ANY 0xffffffff
64#define FUTEX_OP_SET 0
65#define FUTEX_OP_ADD 1
66#define FUTEX_OP_OR 2
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define FUTEX_OP_ANDN 3
68#define FUTEX_OP_XOR 4
69#define FUTEX_OP_OPARG_SHIFT 8
70#define FUTEX_OP_CMP_EQ 0
Ben Cheng655a7c02013-10-16 16:09:24 -070071#define FUTEX_OP_CMP_NE 1
72#define FUTEX_OP_CMP_LT 2
73#define FUTEX_OP_CMP_LE 3
74#define FUTEX_OP_CMP_GT 4
Ben Cheng655a7c02013-10-16 16:09:24 -070075#define FUTEX_OP_CMP_GE 5
Tao Baod7db5942015-01-28 10:07:51 -080076#define FUTEX_OP(op,oparg,cmp,cmparg) (((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
Ben Cheng655a7c02013-10-16 16:09:24 -070077#endif