diff options
Diffstat (limited to 'include/linux/thread_info.h')
-rw-r--r-- | include/linux/thread_info.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index 8d03f079688c..ccc1899bd62e 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #define _LINUX_THREAD_INFO_H | 8 | #define _LINUX_THREAD_INFO_H |
9 | 9 | ||
10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
11 | #include <linux/bug.h> | ||
11 | 12 | ||
12 | struct timespec; | 13 | struct timespec; |
13 | struct compat_timespec; | 14 | struct compat_timespec; |
@@ -54,6 +55,12 @@ extern long do_no_restart_syscall(struct restart_block *parm); | |||
54 | 55 | ||
55 | #ifdef __KERNEL__ | 56 | #ifdef __KERNEL__ |
56 | 57 | ||
58 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
59 | # define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK | __GFP_ZERO) | ||
60 | #else | ||
61 | # define THREADINFO_GFP (GFP_KERNEL | __GFP_NOTRACK) | ||
62 | #endif | ||
63 | |||
57 | /* | 64 | /* |
58 | * flag set/clear/test wrappers | 65 | * flag set/clear/test wrappers |
59 | * - pass TIF_xxxx constants to these functions | 66 | * - pass TIF_xxxx constants to these functions |
@@ -119,10 +126,26 @@ static inline int test_ti_thread_flag(struct thread_info *ti, int flag) | |||
119 | static inline void set_restore_sigmask(void) | 126 | static inline void set_restore_sigmask(void) |
120 | { | 127 | { |
121 | set_thread_flag(TIF_RESTORE_SIGMASK); | 128 | set_thread_flag(TIF_RESTORE_SIGMASK); |
122 | set_thread_flag(TIF_SIGPENDING); | 129 | WARN_ON(!test_thread_flag(TIF_SIGPENDING)); |
130 | } | ||
131 | static inline void clear_restore_sigmask(void) | ||
132 | { | ||
133 | clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
134 | } | ||
135 | static inline bool test_restore_sigmask(void) | ||
136 | { | ||
137 | return test_thread_flag(TIF_RESTORE_SIGMASK); | ||
138 | } | ||
139 | static inline bool test_and_clear_restore_sigmask(void) | ||
140 | { | ||
141 | return test_and_clear_thread_flag(TIF_RESTORE_SIGMASK); | ||
123 | } | 142 | } |
124 | #endif /* TIF_RESTORE_SIGMASK && !HAVE_SET_RESTORE_SIGMASK */ | 143 | #endif /* TIF_RESTORE_SIGMASK && !HAVE_SET_RESTORE_SIGMASK */ |
125 | 144 | ||
145 | #ifndef HAVE_SET_RESTORE_SIGMASK | ||
146 | #error "no set_restore_sigmask() provided and default one won't work" | ||
147 | #endif | ||
148 | |||
126 | #endif /* __KERNEL__ */ | 149 | #endif /* __KERNEL__ */ |
127 | 150 | ||
128 | #endif /* _LINUX_THREAD_INFO_H */ | 151 | #endif /* _LINUX_THREAD_INFO_H */ |