Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ebefe3e authored by Al Viro's avatar Al Viro
Browse files

new helpers: {clear,test,test_and_clear}_restore_sigmask()



helpers parallel to set_restore_sigmask(), used in the next commits

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 754421c8
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -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 */
+16 −0
Original line number Diff line number Diff line
@@ -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__ */
+16 −0
Original line number Diff line number Diff line
@@ -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)
{
+17 −0
Original line number Diff line number Diff line
@@ -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__ */
+16 −0
Original line number Diff line number Diff line
@@ -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__ */
Loading