diff options
Diffstat (limited to 'include/linux/thread_info.h')
-rw-r--r-- | include/linux/thread_info.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index accd7bad35b0..38a56477f27a 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
@@ -92,6 +92,31 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) | |||
92 | #define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) | 92 | #define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) |
93 | #define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) | 93 | #define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) |
94 | 94 | ||
95 | #endif | 95 | #if defined TIF_RESTORE_SIGMASK && !defined HAVE_SET_RESTORE_SIGMASK |
96 | /* | ||
97 | * An arch can define its own version of set_restore_sigmask() to get the | ||
98 | * job done however works, with or without TIF_RESTORE_SIGMASK. | ||
99 | */ | ||
100 | #define HAVE_SET_RESTORE_SIGMASK 1 | ||
101 | |||
102 | /** | ||
103 | * set_restore_sigmask() - make sure saved_sigmask processing gets done | ||
104 | * | ||
105 | * This sets TIF_RESTORE_SIGMASK and ensures that the arch signal code | ||
106 | * will run before returning to user mode, to process the flag. For | ||
107 | * all callers, TIF_SIGPENDING is already set or it's no harm to set | ||
108 | * it. TIF_RESTORE_SIGMASK need not be in the set of bits that the | ||
109 | * arch code will notice on return to user mode, in case those bits | ||
110 | * are scarce. We set TIF_SIGPENDING here to ensure that the arch | ||
111 | * signal code always gets run when TIF_RESTORE_SIGMASK is set. | ||
112 | */ | ||
113 | static inline void set_restore_sigmask(void) | ||
114 | { | ||
115 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
116 | set_thread_flag(TIF_SIGPENDING); | ||
117 | } | ||
118 | #endif /* TIF_RESTORE_SIGMASK && !HAVE_SET_RESTORE_SIGMASK */ | ||
119 | |||
120 | #endif /* __KERNEL__ */ | ||
96 | 121 | ||
97 | #endif /* _LINUX_THREAD_INFO_H */ | 122 | #endif /* _LINUX_THREAD_INFO_H */ |