1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FUTEX_H_
6 #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FUTEX_H_
7 
8 #if !defined(__native_client_nonsfi__)
9 #include <linux/futex.h>
10 #endif  // !defined(__native_client_nonsfi__)
11 
12 #if !defined(FUTEX_WAIT)
13 #define FUTEX_WAIT 0
14 #endif
15 
16 #if !defined(FUTEX_WAKE)
17 #define FUTEX_WAKE 1
18 #endif
19 
20 #if !defined(FUTEX_FD)
21 #define FUTEX_FD 2
22 #endif
23 
24 #if !defined(FUTEX_REQUEUE)
25 #define FUTEX_REQUEUE 3
26 #endif
27 
28 #if !defined(FUTEX_CMP_REQUEUE)
29 #define FUTEX_CMP_REQUEUE 4
30 #endif
31 
32 #if !defined(FUTEX_WAKE_OP)
33 #define FUTEX_WAKE_OP 5
34 #endif
35 
36 #if !defined(FUTEX_LOCK_PI)
37 #define FUTEX_LOCK_PI 6
38 #endif
39 
40 #if !defined(FUTEX_UNLOCK_PI)
41 #define FUTEX_UNLOCK_PI 7
42 #endif
43 
44 #if !defined(FUTEX_TRYLOCK_PI)
45 #define FUTEX_TRYLOCK_PI 8
46 #endif
47 
48 #if !defined(FUTEX_WAIT_BITSET)
49 #define FUTEX_WAIT_BITSET 9
50 #endif
51 
52 #if !defined(FUTEX_WAKE_BITSET)
53 #define FUTEX_WAKE_BITSET 10
54 #endif
55 
56 #if !defined(FUTEX_WAIT_REQUEUE_PI)
57 #define FUTEX_WAIT_REQUEUE_PI 11
58 #endif
59 
60 #if !defined(FUTEX_CMP_REQUEUE_PI)
61 #define FUTEX_CMP_REQUEUE_PI 12
62 #endif
63 
64 #if !defined(FUTEX_PRIVATE_FLAG)
65 #define FUTEX_PRIVATE_FLAG 128
66 #endif
67 
68 #if !defined FUTEX_CLOCK_REALTIME
69 #define FUTEX_CLOCK_REALTIME 256
70 #endif
71 
72 #if !defined(FUTEX_CMD_MASK)
73 #define FUTEX_CMD_MASK ~(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME)
74 #endif
75 
76 #if !defined(FUTEX_CMP_REQUEUE_PI_PRIVATE)
77 #define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)
78 #endif
79 
80 #if !defined(FUTEX_UNLOCK_PI_PRIVATE)
81 #define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
82 #endif
83 
84 #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_FUTEX_H_
85