From e42efa01c9305eb27616bae2bc314d8e44d129e0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 26 Dec 2020 17:57:52 +0100 Subject: hurd: set sigaction for signal preemptors in arch-independent file Instead of having the arch-specific trampoline setup code detect whether preemption happened or not, we'd rather pass it the sigaction. In the future, this may also allow to change sa_flags from post_signal(). --- sysdeps/mach/hurd/i386/trampoline.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'sysdeps/mach') diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c index 1777d0769d..a47bbe9667 100644 --- a/sysdeps/mach/hurd/i386/trampoline.c +++ b/sysdeps/mach/hurd/i386/trampoline.c @@ -80,7 +80,8 @@ static void fill_ucontext (ucontext_t *uc, const struct sigcontext *sc) } struct sigcontext * -_hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, +_hurd_setup_sighandler (struct hurd_sigstate *ss, const struct sigaction *action, + __sighandler_t handler, int signo, struct hurd_signal_detail *detail, volatile int rpc_wait, struct machine_thread_all_state *state) @@ -90,7 +91,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, void firewall (void); extern const void _hurd_intr_rpc_msg_cx_sp; extern const void _hurd_intr_rpc_msg_sp_restored; - const struct sigaction *action; void *volatile sigsp; struct sigcontext *scp; struct @@ -123,11 +123,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, siginfo_t siginfo; } *stackframe; - /* sigaction for preemptors */ - static const struct sigaction legacy_sigaction = { - .sa_flags = SA_RESTART - }; - if (ss->context) { /* We have a previous sigcontext that sigreturn was about @@ -170,14 +165,6 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, the SP on sigreturn. */ state->basic.uesp = state->basic.ecx; - action = & _hurd_sigstate_actions (ss) [signo]; - if ( (action->sa_flags & SA_SIGINFO) - && handler != (__sighandler_t) action->sa_sigaction - || !(action->sa_flags & SA_SIGINFO) - && handler != action->sa_handler) - /* A signal preemptor took over, use legacy semantic. */ - action = &legacy_sigaction; - if ((action->sa_flags & SA_ONSTACK) && !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK))) { -- cgit v1.2.3