]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
new helpers: {clear,test,test_and_clear}_restore_sigmask()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 27 Apr 2012 02:29:20 +0000 (22:29 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 1 Jun 2012 16:58:47 +0000 (12:58 -0400)
helpers parallel to set_restore_sigmask(), used in the next commits

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/ia64/include/asm/thread_info.h
arch/microblaze/include/asm/thread_info.h
arch/powerpc/include/asm/thread_info.h
arch/sh/include/asm/thread_info.h
arch/sparc/include/asm/thread_info_64.h
arch/tile/include/asm/thread_info.h
arch/x86/include/asm/thread_info.h
include/linux/thread_info.h

index 310d9734f02d11a2537311b6860a736ff5fa63a7..8d600363fa573c157d8ae8fce8bcdd3d06af7d76 100644 (file)
@@ -143,6 +143,22 @@ static inline void set_restore_sigmask(void)
        ti->status |= TS_RESTORE_SIGMASK;
        set_bit(TIF_SIGPENDING, &ti->flags);
 }
+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 /* _ASM_IA64_THREAD_INFO_H */
index 1a8ab6a5c03fc3ab399cd8fa75003b4220e69cd5..12e39206b3efcf76f81e1141e204d8356ff4d992 100644 (file)
@@ -168,6 +168,22 @@ static inline void set_restore_sigmask(void)
        ti->status |= TS_RESTORE_SIGMASK;
        set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
 }
+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
 
 #endif /* __KERNEL__ */
index a556ccc16b58d4560b004c1ee797f8e92c7c6506..85d50a93a92fee9bc0d8f890b97c98e0be6a13d4 100644 (file)
@@ -142,6 +142,22 @@ static inline void set_restore_sigmask(void)
        ti->local_flags |= _TLF_RESTORE_SIGMASK;
        set_bit(TIF_SIGPENDING, &ti->flags);
 }
+static inline void clear_restore_sigmask(void)
+{
+       current_thread_info()->local_flags &= ~_TLF_RESTORE_SIGMASK;
+}
+static inline bool test_restore_sigmask(void)
+{
+       return current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK;
+}
+static inline bool test_and_clear_restore_sigmask(void)
+{
+       struct thread_info *ti = current_thread_info();
+       if (!(ti->local_flags & _TLF_RESTORE_SIGMASK))
+               return false;
+       ti->local_flags &= ~_TLF_RESTORE_SIGMASK;
+       return true;
+}
 
 static inline bool test_thread_local_flags(unsigned int flags)
 {
index 0c04ffc4f12c41d344eded872aea06aaf7232e2b..a109157c6b8fe4e7125da524fb32264a66a81679 100644 (file)
@@ -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__ */
index 7f0981b094517aace2b461e2f6d7db9aa6d0fbfa..cb9b7a9f5fc1ccf81b88e268b4d70a41ac20b895 100644 (file)
@@ -240,6 +240,22 @@ static inline void set_restore_sigmask(void)
        ti->status |= TS_RESTORE_SIGMASK;
        set_bit(TIF_SIGPENDING, &ti->flags);
 }
+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__ */
index 656c486e64fafd424863fabe0f66d52a36e5c243..5aef371921e4618a53c3d0a13cef96bfebaca1e1 100644 (file)
@@ -168,6 +168,22 @@ static inline void set_restore_sigmask(void)
        ti->status |= TS_RESTORE_SIGMASK;
        set_bit(TIF_SIGPENDING, &ti->flags);
 }
+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 /* _ASM_TILE_THREAD_INFO_H */
index 5c25de07cba82fca1fbd027a3038f5f6cedf66ec..8f3f1ff69fa98e84e32662e8802d2b8b97d72df8 100644 (file)
@@ -250,6 +250,22 @@ static inline void set_restore_sigmask(void)
        ti->status |= TS_RESTORE_SIGMASK;
        set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
 }
+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;
+}
 
 static inline bool is_ia32_task(void)
 {
index eee72942868338c4be302645cd4aa4f7f70cc7fa..ed279701ac79c9d8f3412553b877cc4b641e9e61 100644 (file)
@@ -127,6 +127,18 @@ static inline void set_restore_sigmask(void)
        set_thread_flag(TIF_RESTORE_SIGMASK);
        set_thread_flag(TIF_SIGPENDING);
 }
+static inline void clear_restore_sigmask(void)
+{
+       clear_thread_flag(TIF_RESTORE_SIGMASK);
+}
+static inline bool test_restore_sigmask(void)
+{
+       return test_thread_flag(TIF_RESTORE_SIGMASK);
+}
+static inline bool test_and_clear_restore_sigmask(void)
+{
+       return test_and_clear_thread_flag(TIF_RESTORE_SIGMASK);
+}
 #endif /* TIF_RESTORE_SIGMASK && !HAVE_SET_RESTORE_SIGMASK */
 
 #ifndef HAVE_SET_RESTORE_SIGMASK