1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/ktime.h>
6 #include <uapi/linux/futex.h>
13 * Futexes are matched on equal values of this key.
14 * The key type depends on whether it's a shared or private mapping.
15 * Don't rearrange members without looking at hash_futex().
17 * offset is aligned to a multiple of sizeof(u32) (== 4) by definition.
18 * We use the two low order bits of offset to tell what is the kind of key :
19 * 00 : Private process futex (PTHREAD_PROCESS_PRIVATE)
20 * (no reference on an inode or mm)
21 * 01 : Shared futex (PTHREAD_PROCESS_SHARED)
22 * mapped on a file (reference on the underlying inode)
23 * 10 : Shared futex (PTHREAD_PROCESS_SHARED)
24 * (but private mapping on an mm, and reference taken on it)
27 #define FUT_OFF_INODE 1 /* We set bit 0 if key has a reference on inode */
28 #define FUT_OFF_MMSHARED 2 /* We set bit 1 if key has a reference on mm */
37 unsigned long address;
48 #define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } }
51 extern void exit_robust_list(struct task_struct *curr);
53 long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
54 u32 __user *uaddr2, u32 val2, u32 val3);
56 static inline void exit_robust_list(struct task_struct *curr)
60 static inline long do_futex(u32 __user *uaddr, int op, u32 val,
61 ktime_t *timeout, u32 __user *uaddr2,
68 #ifdef CONFIG_FUTEX_PI
69 extern void exit_pi_state_list(struct task_struct *curr);
71 static inline void exit_pi_state_list(struct task_struct *curr)