aboutsummaryrefslogtreecommitdiff
path: root/arch/openrisc/kernel/signal.c
AgeCommit message (Collapse)AuthorFilesLines
2013-02-03openrisc: switch to generic sigaltstackAl Viro1-13/+2
Signed-off-by: Al Viro <[email protected]>
2012-11-28openrisk: fix altstack switching on sigreturnAl Viro1-4/+2
do_sigaltstack() expects _userland_ address, TYVM... Signed-off-by: Al Viro <[email protected]>
2012-06-01new helper: signal_delivered()Al Viro1-2/+1
Does block_sigmask() + tracehook_signal_handler(); called when sigframe has been successfully built. All architectures converted to it; block_sigmask() itself is gone now (merged into this one). I'm still not too happy with the signature, but that's a separate story (IMO we need a structure that would contain signal number + siginfo + k_sigaction, so that get_signal_to_deliver() would fill one, signal_delivered(), handle_signal() and probably setup...frame() - take one). Signed-off-by: Al Viro <[email protected]>
2012-06-01most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from setAl Viro1-3/+0
Only 3 out of 63 do not. Renamed the current variant to __set_current_blocked(), added set_current_blocked() that will exclude unblockable signals, switched open-coded instances to it. Signed-off-by: Al Viro <[email protected]>
2012-06-01pull clearing RESTORE_SIGMASK into block_sigmask()Al Viro1-2/+0
Signed-off-by: Al Viro <[email protected]>
2012-06-01openrisc: tracehook_signal_handler() is supposed to be called on successAl Viro1-14/+6
... not if sigframe couldn't have been built. Signed-off-by: Al Viro <[email protected]>
2012-06-01new helper: sigmask_to_save()Al Viro1-9/+3
replace boilerplate "should we use ->saved_sigmask or ->blocked?" with calls of obvious inlined helper... Signed-off-by: Al Viro <[email protected]>
2012-06-01new helper: restore_saved_sigmask()Al Viro1-5/+1
first fruits of ..._restore_sigmask() helpers: now we can take boilerplate "signal didn't have a handler, clear RESTORE_SIGMASK and restore the blocked mask from ->saved_mask" into a common helper. Open-coded instances switched... Signed-off-by: Al Viro <[email protected]>
2012-05-23move key_repace_session_keyring() into tracehook_notify_resume()Al Viro1-2/+0
Signed-off-by: Al Viro <[email protected]>
2012-03-06openrisc: sanitize use of orig_gpr11Jonas Bonn1-1/+1
The pt_regs struct had both a 'syscallno' field and an 'orig_gpr11' field and it wasn't really clear how these were supposed to be used. This patch removes the syscallno field altogether and makes orig_gpr11 work more like other architectures: keep track of syscall number in progress or hold -1 for non-syscall exceptions. Signed-off-by: Jonas Bonn <[email protected]>
2012-02-17OpenRISC: Use set_current_blocked() and block_sigmask()Matt Fleming1-11/+2
As described in e6fa16ab ("signal: sigprocmask() should do retarget_shared_pending()") the modification of current->blocked is incorrect as we need to check whether the signal we're about to block is pending in the shared queue. Also, use the new helper function introduced in commit 5e6292c0f28f ("signal: add block_sigmask() for adding sigmask to current->blocked") which centralises the code for updating current->blocked after successfully delivering a signal and reduces the amount of duplicate code across architectures. In the past some architectures got this code wrong, so using this helper function should stop that from happening again. Cc: Oleg Nesterov <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Signed-off-by: Matt Fleming <[email protected]> Signed-off-by: Jonas Bonn <[email protected]>
2012-02-17OpenRISC: Don't mask signals if we fail to setup signal stackMatt Fleming1-11/+18
setup_rt_frame() needs to return an indication of whether it succeeded or failed in setting up the signal stack frame. If setup_rt_frame() fails then we must not modify current->blocked. Acked-by: Oleg Nesterov <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Signed-off-by: Matt Fleming <[email protected]> Signed-off-by: Jonas Bonn <[email protected]>
2012-02-17OpenRISC: No need to reset handler if SA_ONESHOTMatt Fleming1-3/+0
get_signal_to_deliver() already resets the signal handler if SA_ONESHOT is set in ka->sa.sa_flags, there's no need to do it again in handle_signal(). Furthermore, because we were modifying ka->sa.sa_handler (which is a copy of sighand->action[]) instead of sighand->action[] the original code actually had no effect on signal delivery. Acked-by: Oleg Nesterov <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Signed-off-by: Matt Fleming <[email protected]> Signed-off-by: Jonas Bonn <[email protected]>
2012-02-17OpenRISC: Don't reimplement force_sigsegv()Matt Fleming1-3/+1
Instead of open coding the sequence from force_sigsegv() just call it. This also fixes a bug because we were modifying ka->sa.sa_handler (which is a copy of sighand->action[]), whereas the intention of the code was to modify sighand->action[] directly. As the original code was working with a copy it had no effect on signal delivery. Acked-by: Oleg Nesterov <[email protected]> Cc: Jonas Bonn <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: [email protected] Signed-off-by: Matt Fleming <[email protected]> Signed-off-by: Jonas Bonn <[email protected]>
2011-09-05openrisc: don't use pt_regs in struct sigcontextJonas Bonn1-18/+11
As it was decided not to export struct pt_regs to userspace, struct sigcontext shouldn't be using it either. The pt_regs struct for OpenRISC is kernel internal and the layout of the registers may change in the future. The struct user_regs_struct is what is guaranteed to remain stable, so struct sigcontext may use that instead. This patch removes the usage of struct pt_regs in struct sigcontext and makes according changes in signal.c to get the register layout right. The usp field is removed from the sigcontext structure as this information is already contained in the user_regs_struct. Signed-off-by: Jonas Bonn <[email protected]> Reviewed-by: Emilio Cota <[email protected]>
2011-07-22OpenRISC: Signal handlingJonas Bonn1-0/+396
Signed-off-by: Jonas Bonn <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]>