]>
Commit | Line | Data |
---|---|---|
7c68af6e AK |
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 | ||
8e7cac79 AK |
29 | static inline void clear_user_return_notifier(struct task_struct *p) |
30 | { | |
31 | clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY); | |
32 | } | |
33 | ||
7c68af6e AK |
34 | #else |
35 | ||
36 | struct user_return_notifier {}; | |
37 | ||
38 | static inline void propagate_user_return_notify(struct task_struct *prev, | |
39 | struct task_struct *next) | |
40 | { | |
41 | } | |
42 | ||
43 | static inline void fire_user_return_notifiers(void) {} | |
44 | ||
8e7cac79 AK |
45 | static inline void clear_user_return_notifier(struct task_struct *p) {} |
46 | ||
7c68af6e AK |
47 | #endif |
48 | ||
49 | #endif |