aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-26 22:29:20 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 12:58:47 -0400
commit4ebefe3ec729003443daf153ed6fad1739271283 (patch)
treecea05e7086314d200886fd3b76867e8fb5e6574b
parent754421c8cab1a568be844a7069fe04c1cf6391b8 (diff)
new helpers: {clear,test,test_and_clear}_restore_sigmask()
helpers parallel to set_restore_sigmask(), used in the next commits Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/ia64/include/asm/thread_info.h16
-rw-r--r--arch/microblaze/include/asm/thread_info.h16
-rw-r--r--arch/powerpc/include/asm/thread_info.h16
-rw-r--r--arch/sh/include/asm/thread_info.h17
-rw-r--r--arch/sparc/include/asm/thread_info_64.h16
-rw-r--r--arch/tile/include/asm/thread_info.h16
-rw-r--r--arch/x86/include/asm/thread_info.h16
-rw-r--r--include/linux/thread_info.h12
8 files changed, 125 insertions, 0 deletions
diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h
index 310d9734f02d..8d600363fa57 100644
--- a/arch/ia64/include/asm/thread_info.h
+++ b/arch/ia64/include/asm/thread_info.h
@@ -143,6 +143,22 @@ static inline void set_restore_sigmask(void)
143 ti->status |= TS_RESTORE_SIGMASK; 143 ti->status |= TS_RESTORE_SIGMASK;
144 set_bit(TIF_SIGPENDING, &ti->flags); 144 set_bit(TIF_SIGPENDING, &ti->flags);
145} 145}
146static inline void clear_restore_sigmask(void)
147{
148 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
149}
150static inline bool test_restore_sigmask(void)
151{
152 return current_thread_info()->status & TS_RESTORE_SIGMASK;
153}
154static inline bool test_and_clear_restore_sigmask(void)
155{
156 struct thread_info *ti = current_thread_info();
157 if (!(ti->status & TS_RESTORE_SIGMASK))
158 return false;
159 ti->status &= ~TS_RESTORE_SIGMASK;
160 return true;
161}
146#endif /* !__ASSEMBLY__ */ 162#endif /* !__ASSEMBLY__ */
147 163
148#endif /* _ASM_IA64_THREAD_INFO_H */ 164#endif /* _ASM_IA64_THREAD_INFO_H */
diff --git a/arch/microblaze/include/asm/thread_info.h b/arch/microblaze/include/asm/thread_info.h
index 1a8ab6a5c03f..12e39206b3ef 100644
--- a/arch/microblaze/include/asm/thread_info.h
+++ b/arch/microblaze/include/asm/thread_info.h
@@ -168,6 +168,22 @@ static inline void set_restore_sigmask(void)
168 ti->status |= TS_RESTORE_SIGMASK; 168 ti->status |= TS_RESTORE_SIGMASK;
169 set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags); 169 set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
170} 170}
171static inline void clear_restore_sigmask(void)
172{
173 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
174}
175static inline bool test_restore_sigmask(void)
176{
177 return current_thread_info()->status & TS_RESTORE_SIGMASK;
178}
179static inline bool test_and_clear_restore_sigmask(void)
180{
181 struct thread_info *ti = current_thread_info();
182 if (!(ti->status & TS_RESTORE_SIGMASK))
183 return false;
184 ti->status &= ~TS_RESTORE_SIGMASK;
185 return true;
186}
171#endif 187#endif
172 188
173#endif /* __KERNEL__ */ 189#endif /* __KERNEL__ */
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index a556ccc16b58..85d50a93a92f 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -142,6 +142,22 @@ static inline void set_restore_sigmask(void)
142 ti->local_flags |= _TLF_RESTORE_SIGMASK; 142 ti->local_flags |= _TLF_RESTORE_SIGMASK;
143 set_bit(TIF_SIGPENDING, &ti->flags); 143 set_bit(TIF_SIGPENDING, &ti->flags);
144} 144}
145static inline void clear_restore_sigmask(void)
146{
147 current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK;
148}
149static inline bool test_restore_sigmask(void)
150{
151 return current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK;
152}
153static inline bool test_and_clear_restore_sigmask(void)
154{
155 struct thread_info *ti = current_thread_info();
156 if (!(ti->local_flags & _TLF_RESTORE_SIGMASK))
157 return false;
158 ti->local_flags &= ~_TLF_RESTORE_SIGMASK;
159 return true;
160}
145 161
146static inline bool test_thread_local_flags(unsigned int flags) 162static inline bool test_thread_local_flags(unsigned int flags)
147{ 163{
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h
index 0c04ffc4f12c..a109157c6b8f 100644
--- a/arch/sh/include/asm/thread_info.h
+++ b/arch/sh/include/asm/thread_info.h
@@ -189,6 +189,23 @@ static inline unsigned int get_thread_fault_code(void)
189 struct thread_info *ti = current_thread_info(); 189 struct thread_info *ti = current_thread_info();
190 return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT; 190 return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT;
191} 191}
192
193static inline void clear_restore_sigmask(void)
194{
195 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
196}
197static inline bool test_restore_sigmask(void)
198{
199 return current_thread_info()->status & TS_RESTORE_SIGMASK;
200}
201static inline bool test_and_clear_restore_sigmask(void)
202{
203 struct thread_info *ti = current_thread_info();
204 if (!(ti->status & TS_RESTORE_SIGMASK))
205 return false;
206 ti->status &= ~TS_RESTORE_SIGMASK;
207 return true;
208}
192#endif /* !__ASSEMBLY__ */ 209#endif /* !__ASSEMBLY__ */
193 210
194#endif /* __KERNEL__ */ 211#endif /* __KERNEL__ */
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index 7f0981b09451..cb9b7a9f5fc1 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -240,6 +240,22 @@ static inline void set_restore_sigmask(void)
240 ti->status |= TS_RESTORE_SIGMASK; 240 ti->status |= TS_RESTORE_SIGMASK;
241 set_bit(TIF_SIGPENDING, &ti->flags); 241 set_bit(TIF_SIGPENDING, &ti->flags);
242} 242}
243static inline void clear_restore_sigmask(void)
244{
245 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
246}
247static inline bool test_restore_sigmask(void)
248{
249 return current_thread_info()->status & TS_RESTORE_SIGMASK;
250}
251static inline bool test_and_clear_restore_sigmask(void)
252{
253 struct thread_info *ti = current_thread_info();
254 if (!(ti->status & TS_RESTORE_SIGMASK))
255 return false;
256 ti->status &= ~TS_RESTORE_SIGMASK;
257 return true;
258}
243#endif /* !__ASSEMBLY__ */ 259#endif /* !__ASSEMBLY__ */
244 260
245#endif /* __KERNEL__ */ 261#endif /* __KERNEL__ */
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h
index 656c486e64fa..5aef371921e4 100644
--- a/arch/tile/include/asm/thread_info.h
+++ b/arch/tile/include/asm/thread_info.h
@@ -168,6 +168,22 @@ static inline void set_restore_sigmask(void)
168 ti->status |= TS_RESTORE_SIGMASK; 168 ti->status |= TS_RESTORE_SIGMASK;
169 set_bit(TIF_SIGPENDING, &ti->flags); 169 set_bit(TIF_SIGPENDING, &ti->flags);
170} 170}
171static inline void clear_restore_sigmask(void)
172{
173 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
174}
175static inline bool test_restore_sigmask(void)
176{
177 return current_thread_info()->status & TS_RESTORE_SIGMASK;
178}
179static inline bool test_and_clear_restore_sigmask(void)
180{
181 struct thread_info *ti = current_thread_info();
182 if (!(ti->status & TS_RESTORE_SIGMASK))
183 return false;
184 ti->status &= ~TS_RESTORE_SIGMASK;
185 return true;
186}
171#endif /* !__ASSEMBLY__ */ 187#endif /* !__ASSEMBLY__ */
172 188
173#endif /* _ASM_TILE_THREAD_INFO_H */ 189#endif /* _ASM_TILE_THREAD_INFO_H */
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 5c25de07cba8..8f3f1ff69fa9 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -250,6 +250,22 @@ static inline void set_restore_sigmask(void)
250 ti->status |= TS_RESTORE_SIGMASK; 250 ti->status |= TS_RESTORE_SIGMASK;
251 set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags); 251 set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
252} 252}
253static inline void clear_restore_sigmask(void)
254{
255 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
256}
257static inline bool test_restore_sigmask(void)
258{
259 return current_thread_info()->status & TS_RESTORE_SIGMASK;
260}
261static inline bool test_and_clear_restore_sigmask(void)
262{
263 struct thread_info *ti = current_thread_info();
264 if (!(ti->status & TS_RESTORE_SIGMASK))
265 return false;
266 ti->status &= ~TS_RESTORE_SIGMASK;
267 return true;
268}
253 269
254static inline bool is_ia32_task(void) 270static inline bool is_ia32_task(void)
255{ 271{
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h
index eee729428683..ed279701ac79 100644
--- a/include/linux/thread_info.h
+++ b/include/linux/thread_info.h
@@ -127,6 +127,18 @@ static inline void set_restore_sigmask(void)
127 set_thread_flag(TIF_RESTORE_SIGMASK); 127 set_thread_flag(TIF_RESTORE_SIGMASK);
128 set_thread_flag(TIF_SIGPENDING); 128 set_thread_flag(TIF_SIGPENDING);
129} 129}
130static inline void clear_restore_sigmask(void)
131{
132 clear_thread_flag(TIF_RESTORE_SIGMASK);
133}
134static inline bool test_restore_sigmask(void)
135{
136 return test_thread_flag(TIF_RESTORE_SIGMASK);
137}
138static inline bool test_and_clear_restore_sigmask(void)
139{
140 return test_and_clear_thread_flag(TIF_RESTORE_SIGMASK);
141}
130#endif /* TIF_RESTORE_SIGMASK && !HAVE_SET_RESTORE_SIGMASK */ 142#endif /* TIF_RESTORE_SIGMASK && !HAVE_SET_RESTORE_SIGMASK */
131 143
132#ifndef HAVE_SET_RESTORE_SIGMASK 144#ifndef HAVE_SET_RESTORE_SIGMASK