diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-03 02:30:06 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-12-03 02:30:06 -0500 |
commit | 58988b07cfe2ebe9f9b39d973fd8a083390e749f (patch) | |
tree | f7a164abe85b8aa768c58a80c1261208372fb4b0 /include | |
parent | 22763c5cf3690a681551162c15d34d935308c8d7 (diff) | |
parent | 8e7cac79808b62f242069a6ac88d364d35621371 (diff) |
Merge remote branch 'tip/x86/entry' into kvm-updates/2.6.33
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/user-return-notifier.h | 49 |
1 files changed, 49 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..9c4a445bb43c --- /dev/null +++ b/include/linux/user-return-notifier.h | |||
@@ -0,0 +1,49 @@ | |||
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 | static inline void clear_user_return_notifier(struct task_struct *p) | ||
30 | { | ||
31 | clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY); | ||
32 | } | ||
33 | |||
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 | |||
45 | static inline void clear_user_return_notifier(struct task_struct *p) {} | ||
46 | |||
47 | #endif | ||
48 | |||
49 | #endif | ||