Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull third pile of signal handling patches from Al Viro: "This time it's mostly helpers and conversions to them; there's a lot of stuff remaining in the tree, but that'll either go in -rc2 (isolated bug fixes, ideally via arch maintainers' trees) or will sit there until the next cycle." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: x86: get rid of calling do_notify_resume() when returning to kernel mode blackfin: check __get_user() return value whack-a-mole with TIF_FREEZE FRV: Optimise the system call exit path in entry.S [ver #2] FRV: Shrink TIF_WORK_MASK [ver #2] FRV: Prevent syscall exit tracing and notify_resume at end of kernel exceptions new helper: signal_delivered() powerpc: get rid of restore_sigmask() most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from set set_restore_sigmask() is never called without SIGPENDING (and never should be) TIF_RESTORE_SIGMASK can be set only when TIF_SIGPENDING is set don't call try_to_freeze() from do_signal() pull clearing RESTORE_SIGMASK into block_sigmask() sh64: failure to build sigframe != signal without handler openrisc: tracehook_signal_handler() is supposed to be called on success new helper: sigmask_to_save() new helper: restore_saved_sigmask() new helpers: {clear,test,test_and_clear}_restore_sigmask() HAVE_RESTORE_SIGMASK is defined on all architectures now
This commit is contained in:
@@ -169,7 +169,7 @@ static inline void set_restore_sigmask(void)
|
||||
{
|
||||
struct thread_info *ti = current_thread_info();
|
||||
ti->status |= TS_RESTORE_SIGMASK;
|
||||
set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
|
||||
WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags));
|
||||
}
|
||||
|
||||
#define TI_FLAG_FAULT_CODE_SHIFT 24
|
||||
@@ -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__ */
|
||||
|
Reference in New Issue
Block a user