summaryrefslogtreecommitdiffstats
path: root/arch/sh/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-27 04:29:20 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 18:58:47 +0200
commit4ebefe3ec729003443daf153ed6fad1739271283 (patch)
treecea05e7086314d200886fd3b76867e8fb5e6574b /arch/sh/include
parentHAVE_RESTORE_SIGMASK is defined on all architectures now (diff)
downloadlinux-4ebefe3ec729003443daf153ed6fad1739271283.tar.xz
linux-4ebefe3ec729003443daf153ed6fad1739271283.zip
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>
Diffstat (limited to 'arch/sh/include')
-rw-r--r--arch/sh/include/asm/thread_info.h17
1 files changed, 17 insertions, 0 deletions
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)
struct thread_info *ti = current_thread_info();
return ti->flags >> TI_FLAG_FAULT_CODE_SHIFT;
}
+
+static inline void clear_restore_sigmask(void)
+{
+ current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
+}
+static inline bool test_restore_sigmask(void)
+{
+ return current_thread_info()->status & TS_RESTORE_SIGMASK;
+}
+static inline bool test_and_clear_restore_sigmask(void)
+{
+ struct thread_info *ti = current_thread_info();
+ if (!(ti->status & TS_RESTORE_SIGMASK))
+ return false;
+ ti->status &= ~TS_RESTORE_SIGMASK;
+ return true;
+}
#endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */