aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/hexagon/kernel/signal.c')
-rw-r--r--arch/hexagon/kernel/signal.c48
1 files changed, 8 insertions, 40 deletions
diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
index 21a3018cb9bf..304b0808d072 100644
--- a/arch/hexagon/kernel/signal.c
+++ b/arch/hexagon/kernel/signal.c
@@ -31,8 +31,6 @@
31#include <asm/signal.h> 31#include <asm/signal.h>
32#include <asm/vdso.h> 32#include <asm/vdso.h>
33 33
34#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
35
36struct rt_sigframe { 34struct rt_sigframe {
37 unsigned long tramp[2]; 35 unsigned long tramp[2];
38 struct siginfo info; 36 struct siginfo info;
@@ -149,11 +147,9 @@ sigsegv:
149/* 147/*
150 * Setup invocation of signal handler 148 * Setup invocation of signal handler
151 */ 149 */
152static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka, 150static void handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
153 sigset_t *oldset, struct pt_regs *regs) 151 struct pt_regs *regs)
154{ 152{
155 int rc;
156
157 /* 153 /*
158 * If we're handling a signal that aborted a system call, 154 * If we're handling a signal that aborted a system call,
159 * set up the error return value before adding the signal 155 * set up the error return value before adding the signal
@@ -186,15 +182,12 @@ static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
186 * Set up the stack frame; not doing the SA_SIGINFO thing. We 182 * Set up the stack frame; not doing the SA_SIGINFO thing. We
187 * only set up the rt_frame flavor. 183 * only set up the rt_frame flavor.
188 */ 184 */
189 rc = setup_rt_frame(sig, ka, info, oldset, regs);
190
191 /* If there was an error on setup, no signal was delivered. */ 185 /* If there was an error on setup, no signal was delivered. */
192 if (rc) 186 if (setup_rt_frame(sig, ka, info, sigmask_to_save(), regs) < 0)
193 return rc; 187 return;
194
195 block_sigmask(ka, sig);
196 188
197 return 0; 189 signal_delivered(sig, info, ka, regs,
190 test_thread_flag(TIF_SINGLESTEP));
198} 191}
199 192
200/* 193/*
@@ -209,34 +202,13 @@ static void do_signal(struct pt_regs *regs)
209 if (!user_mode(regs)) 202 if (!user_mode(regs))
210 return; 203 return;
211 204
212 if (try_to_freeze())
213 goto no_signal;
214
215 signo = get_signal_to_deliver(&info, &sigact, regs, NULL); 205 signo = get_signal_to_deliver(&info, &sigact, regs, NULL);
216 206
217 if (signo > 0) { 207 if (signo > 0) {
218 sigset_t *oldset; 208 handle_signal(signo, &info, &sigact, regs);
219
220 if (test_thread_flag(TIF_RESTORE_SIGMASK))
221 oldset = &current->saved_sigmask;
222 else
223 oldset = &current->blocked;
224
225 if (handle_signal(signo, &info, &sigact, oldset, regs) == 0) {
226 /*
227 * Successful delivery case. The saved sigmask is
228 * stored in the signal frame, and will be restored
229 * by sigreturn. We can clear the TIF flag.
230 */
231 clear_thread_flag(TIF_RESTORE_SIGMASK);
232
233 tracehook_signal_handler(signo, &info, &sigact, regs,
234 test_thread_flag(TIF_SINGLESTEP));
235 }
236 return; 209 return;
237 } 210 }
238 211
239no_signal:
240 /* 212 /*
241 * If we came from a system call, handle the restart. 213 * If we came from a system call, handle the restart.
242 */ 214 */
@@ -259,10 +231,7 @@ no_signal:
259 231
260no_restart: 232no_restart:
261 /* If there's no signal to deliver, put the saved sigmask back */ 233 /* If there's no signal to deliver, put the saved sigmask back */
262 if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 234 restore_saved_sigmask();
263 clear_thread_flag(TIF_RESTORE_SIGMASK);
264 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
265 }
266} 235}
267 236
268void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) 237void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
@@ -301,7 +270,6 @@ asmlinkage int sys_rt_sigreturn(void)
301 if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked))) 270 if (__copy_from_user(&blocked, &frame->uc.uc_sigmask, sizeof(blocked)))
302 goto badframe; 271 goto badframe;
303 272
304 sigdelsetmask(&blocked, ~_BLOCKABLE);
305 set_current_blocked(&blocked); 273 set_current_blocked(&blocked);
306 274
307 if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) 275 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))