Clean up signal_delivered()

- Pass a ksignal struct to it
 - Remove unused regs parameter
 - Make it private as it's nowhere outside of kernel/signal.c is used

Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
Richard Weinberger 2014-07-13 13:36:04 +02:00 committed by Richard Weinberger
parent df5601f9c3
commit 10b1c7ac8b
2 changed files with 8 additions and 14 deletions

View File

@ -282,7 +282,6 @@ struct ksignal {
extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping); extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping);
extern void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, struct pt_regs *regs, int stepping);
extern void exit_signals(struct task_struct *tsk); extern void exit_signals(struct task_struct *tsk);
extern void kernel_sigaction(int, __sighandler_t); extern void kernel_sigaction(int, __sighandler_t);

View File

@ -2353,19 +2353,15 @@ relock:
/** /**
* signal_delivered - * signal_delivered -
* @sig: number of signal being delivered * @ksig: kernel signal struct
* @info: siginfo_t of signal being delivered
* @ka: sigaction setting that chose the handler
* @regs: user register state
* @stepping: nonzero if debugger single-step or block-step in use * @stepping: nonzero if debugger single-step or block-step in use
* *
* This function should be called when a signal has successfully been * This function should be called when a signal has successfully been
* delivered. It updates the blocked signals accordingly (@ka->sa.sa_mask * delivered. It updates the blocked signals accordingly (@ksig->ka.sa.sa_mask
* is always blocked, and the signal itself is blocked unless %SA_NODEFER * is always blocked, and the signal itself is blocked unless %SA_NODEFER
* is set in @ka->sa.sa_flags. Tracing is notified. * is set in @ksig->ka.sa.sa_flags. Tracing is notified.
*/ */
void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka, static void signal_delivered(struct ksignal *ksig, int stepping)
struct pt_regs *regs, int stepping)
{ {
sigset_t blocked; sigset_t blocked;
@ -2375,9 +2371,9 @@ void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka,
simply clear the restore sigmask flag. */ simply clear the restore sigmask flag. */
clear_restore_sigmask(); clear_restore_sigmask();
sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask); sigorsets(&blocked, &current->blocked, &ksig->ka.sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NODEFER)) if (!(ksig->ka.sa.sa_flags & SA_NODEFER))
sigaddset(&blocked, sig); sigaddset(&blocked, ksig->sig);
set_current_blocked(&blocked); set_current_blocked(&blocked);
tracehook_signal_handler(stepping); tracehook_signal_handler(stepping);
} }
@ -2387,8 +2383,7 @@ void signal_setup_done(int failed, struct ksignal *ksig, int stepping)
if (failed) if (failed)
force_sigsegv(ksig->sig, current); force_sigsegv(ksig->sig, current);
else else
signal_delivered(ksig->sig, &ksig->info, &ksig->ka, signal_delivered(ksig, stepping);
signal_pt_regs(), stepping);
} }
/* /*