Commit efee984c authored by Al Viro's avatar Al Viro
Browse files

new helper: signal_delivered()



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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 17440f17
......@@ -478,7 +478,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
force_sigsegv(sig, current);
return;
}
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
static inline void
......
......@@ -557,12 +557,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
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);
}
/*
......
......@@ -241,7 +241,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
if (ret != 0)
force_sigsegv(sig, current);
else
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
/*
......
......@@ -260,8 +260,7 @@ handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
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));
}
......
......@@ -276,8 +276,7 @@ static void handle_signal(int sig,
/* 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);
}
/*
......
......@@ -453,7 +453,7 @@ static inline void handle_signal(int canrestart, unsigned long sig,
ret = setup_frame(sig, ka, oldset, regs);
if (ret == 0)
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
/*
......
......@@ -485,7 +485,7 @@ handle_signal(int canrestart, unsigned long sig,
ret = setup_frame(sig, ka, oldset, regs);
if (ret == 0)
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
/*
......
......@@ -460,8 +460,7 @@ static void handle_signal(unsigned long sig, siginfo_t *info,
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() */
......
......@@ -439,7 +439,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
ret = setup_frame(sig, ka, oldset, regs);
if (!ret)
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
/*
......
......@@ -186,8 +186,7 @@ static void handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
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));
}
......
......@@ -419,12 +419,7 @@ handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
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;
......
......@@ -294,7 +294,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs))
return;
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
/*
......
......@@ -1137,7 +1137,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
if (err)
return;
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
if (test_thread_flag(TIF_DELAYED_TRACE)) {
regs->sr &= ~0x8000;
......
......@@ -323,7 +323,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
if (ret)
return;
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
/*
......
......@@ -551,7 +551,7 @@ static void handle_signal(unsigned long sig, siginfo_t *info,
if (ret)
return;
block_sigmask(ka, sig);
signal_delivered(sig, info, ka, regs, 0);
}
static void do_signal(struct pt_regs *regs)
......
......@@ -461,8 +461,7 @@ static int handle_signal(int sig,
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));
}
......
......@@ -259,8 +259,7 @@ handle_signal(unsigned long sig,
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));
}
......
......@@ -449,9 +449,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
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));
......
......@@ -148,11 +148,7 @@ static int do_signal(struct pt_regs *regs)
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));
}
......
......@@ -580,11 +580,7 @@ void handle_signal32(unsigned long sig, struct k_sigaction *ka,
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));
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment