force_sigsegv(sig, current);
return;
}
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
static inline void
force_sigsegv(sig, tsk);
return;
}
-
- /*
- * Block the signal if we were successful.
- */
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs, 0);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
if (ret != 0)
force_sigsegv(sig, current);
else
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
if (ret)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLESTEP));
}
/* Set up the stack frame */
if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs) < 0)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs, 0);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
ret = setup_frame(sig, ka, oldset, regs);
if (ret == 0)
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
ret = setup_frame(sig, ka, oldset, regs);
if (ret == 0)
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
if (ret)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, __frame,
+ signal_delivered(sig, info, ka, __frame,
test_thread_flag(TIF_SINGLESTEP));
} /* end handle_signal() */
ret = setup_frame(sig, ka, oldset, regs);
if (!ret)
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs) < 0)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLESTEP));
}
if (!setup_frame(sig, ka, info, sigmask_to_save(), scr))
return 0;
- block_sigmask(ka, sig);
-
- /*
- * Let tracing know that we've done the handler setup.
- */
- tracehook_signal_handler(sig, info, ka, &scr->pt,
+ signal_delivered(sig, info, ka, &scr->pt,
test_thread_flag(TIF_SINGLESTEP));
return 1;
if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs))
return;
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
if (err)
return;
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
if (test_thread_flag(TIF_DELAYED_TRACE)) {
regs->sr &= ~0x8000;
if (ret)
return;
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
if (ret)
return;
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
static void do_signal(struct pt_regs *regs)
if (ret)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLESTEP));
}
if (ret)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLESTEP));
}
if (!setup_rt_frame(sig, ka, info, oldset, regs, in_syscall))
return 0;
- block_sigmask(ka, sig);
-
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLESTEP) ||
test_thread_flag(TIF_BLOCKSTEP));
regs->trap = 0;
if (ret) {
- block_sigmask(&ka, signr);
- /*
- * Let tracing know that we've done the handler setup.
- */
- tracehook_signal_handler(signr, &info, &ka, regs,
+ signal_delivered(signr, &info, &ka, regs,
test_thread_flag(TIF_SINGLESTEP));
}
ret = setup_frame32(sig, ka, oldset, regs);
if (ret)
return;
- block_sigmask(ka, sig);
- /*
- * Let tracing know that we've done the handler setup.
- */
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLE_STEP));
}
ret = setup_frame(sig, ka, oldset, regs);
if (ret)
return;
- block_sigmask(ka, sig);
- /*
- * Let tracing know that we've done the handler setup.
- */
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLE_STEP));
}
if (setup_rt_frame(ka, regs, sig, sigmask_to_save(), info) < 0)
return;
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
static void do_signal(struct pt_regs *regs)
if (ret)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLESTEP));
}
if (ret)
return;
- block_sigmask(ka, sig);
- tracehook_signal_handler(sig, info, ka, regs,
+ signal_delivered(sig, info, ka, regs,
test_thread_flag(TIF_SINGLESTEP));
}
if (err)
return;
- block_sigmask(ka, signr);
- tracehook_signal_handler(signr, info, ka, regs, 0);
+ signal_delivered(signr, info, ka, regs, 0);
}
static inline void syscall_restart32(unsigned long orig_i0, struct pt_regs *regs,
if (err)
return;
- block_sigmask(ka, signr);
- tracehook_signal_handler(signr, info, ka, regs, 0);
+ signal_delivered(signr, info, ka, regs, 0);
}
static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
if (err)
return;
- block_sigmask(ka, signr);
- tracehook_signal_handler(signr, info, ka, regs, 0);
+ signal_delivered(signr, info, ka, regs, 0);
}
static inline void syscall_restart(unsigned long orig_i0, struct pt_regs *regs,
ret = setup_rt_frame(sig, ka, info, oldset, regs);
if (ret)
return;
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
if (err)
force_sigsegv(signr, current);
else
- block_sigmask(ka, signr);
+ signal_delivered(signr, info, ka, regs, 0);
}
static int kern_do_signal(struct pt_regs *regs)
return;
}
- /*
- * Block the signal if we were successful.
- */
- block_sigmask(ka, sig);
+ signal_delivered(sig, info, ka, regs, 0);
}
/*
*/
regs->flags &= ~X86_EFLAGS_TF;
- block_sigmask(ka, sig);
-
- tracehook_signal_handler(sig, info, ka, regs,
- test_thread_flag(TIF_SINGLESTEP));
+ signal_delivered(sig, info, ka, regs,
+ test_thread_flag(TIF_SINGLESTEP));
}
#ifdef CONFIG_X86_32
if (ret)
return;
- block_sigmask(&ka, signr);
+ signal_delivered(signr, info, ka, regs, 0);
if (current->ptrace & PT_SINGLESTEP)
task_pt_regs(current)->icountlevel = 1;
extern int sigsuspend(sigset_t *);
extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
-extern void block_sigmask(struct k_sigaction *ka, int signr);
+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 struct kmem_cache *sighand_cachep;
}
/**
- * block_sigmask - add @ka's signal mask to current->blocked
- * @ka: action for @signr
- * @signr: signal that has been successfully delivered
+ * signal_delivered -
+ * @sig: number of signal being delivered
+ * @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
*
* This function should be called when a signal has succesfully been
- * delivered. It adds the mask of signals for @ka to current->blocked
- * so that they are blocked during the execution of the signal
- * handler. In addition, @signr will be blocked unless %SA_NODEFER is
- * set in @ka->sa.sa_flags.
+ * delivered. It updates the blocked signals accordingly (@ka->sa.sa_mask
+ * is always blocked, and the signal itself is blocked unless %SA_NODEFER
+ * is set in @ka->sa.sa_flags. Tracing is notified.
*/
-void block_sigmask(struct k_sigaction *ka, int signr)
+void signal_delivered(int sig, siginfo_t *info, struct k_sigaction *ka,
+ struct pt_regs *regs, int stepping)
{
sigset_t blocked;
sigorsets(&blocked, ¤t->blocked, &ka->sa.sa_mask);
if (!(ka->sa.sa_flags & SA_NODEFER))
- sigaddset(&blocked, signr);
+ sigaddset(&blocked, sig);
set_current_blocked(&blocked);
+ tracehook_signal_handler(sig, info, ka, regs, stepping);
}
/*