1
2#ifndef _LINUX_FUTEX_H
3#define _LINUX_FUTEX_H
4
5#include <linux/ktime.h>
6#include <uapi/linux/futex.h>
7
8struct inode;
9struct mm_struct;
10struct task_struct;
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27#define FUT_OFF_INODE 1
28#define FUT_OFF_MMSHARED 2
29
30union futex_key {
31 struct {
32 unsigned long pgoff;
33 struct inode *inode;
34 int offset;
35 } shared;
36 struct {
37 unsigned long address;
38 struct mm_struct *mm;
39 int offset;
40 } private;
41 struct {
42 unsigned long word;
43 void *ptr;
44 int offset;
45 } both;
46};
47
48#define FUTEX_KEY_INIT (union futex_key) { .both = { .ptr = NULL } }
49
50#ifdef CONFIG_FUTEX
51extern void exit_robust_list(struct task_struct *curr);
52
53long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
54 u32 __user *uaddr2, u32 val2, u32 val3);
55#else
56static inline void exit_robust_list(struct task_struct *curr)
57{
58}
59
60static inline long do_futex(u32 __user *uaddr, int op, u32 val,
61 ktime_t *timeout, u32 __user *uaddr2,
62 u32 val2, u32 val3)
63{
64 return -EINVAL;
65}
66#endif
67
68#ifdef CONFIG_FUTEX_PI
69extern void exit_pi_state_list(struct task_struct *curr);
70#else
71static inline void exit_pi_state_list(struct task_struct *curr)
72{
73}
74#endif
75
76#endif
77