diff options
Diffstat (limited to 'include/linux/user-return-notifier.h')
-rw-r--r-- | include/linux/user-return-notifier.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/user-return-notifier.h b/include/linux/user-return-notifier.h new file mode 100644 index 000000000000..b6ac056291d7 --- /dev/null +++ b/include/linux/user-return-notifier.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef _LINUX_USER_RETURN_NOTIFIER_H | ||
2 | #define _LINUX_USER_RETURN_NOTIFIER_H | ||
3 | |||
4 | #ifdef CONFIG_USER_RETURN_NOTIFIER | ||
5 | |||
6 | #include <linux/list.h> | ||
7 | #include <linux/sched.h> | ||
8 | |||
9 | struct user_return_notifier { | ||
10 | void (*on_user_return)(struct user_return_notifier *urn); | ||
11 | struct hlist_node link; | ||
12 | }; | ||
13 | |||
14 | |||
15 | void user_return_notifier_register(struct user_return_notifier *urn); | ||
16 | void user_return_notifier_unregister(struct user_return_notifier *urn); | ||
17 | |||
18 | static inline void propagate_user_return_notify(struct task_struct *prev, | ||
19 | struct task_struct *next) | ||
20 | { | ||
21 | if (test_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY)) { | ||
22 | clear_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY); | ||
23 | set_tsk_thread_flag(next, TIF_USER_RETURN_NOTIFY); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | void fire_user_return_notifiers(void); | ||
28 | |||
29 | #else | ||
30 | |||
31 | struct user_return_notifier {}; | ||
32 | |||
33 | static inline void propagate_user_return_notify(struct task_struct *prev, | ||
34 | struct task_struct *next) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | static inline void fire_user_return_notifiers(void) {} | ||
39 | |||
40 | #endif | ||
41 | |||
42 | #endif | ||