Commit | Line | Data |
---|---|---|
b920de1b DH |
1 | /* MN10300 Signal handling |
2 | * | |
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | |
4 | * Written by David Howells (dhowells@redhat.com) | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public Licence | |
8 | * as published by the Free Software Foundation; either version | |
9 | * 2 of the Licence, or (at your option) any later version. | |
10 | */ | |
11 | ||
12 | #include <linux/sched.h> | |
13 | #include <linux/mm.h> | |
14 | #include <linux/smp.h> | |
b920de1b DH |
15 | #include <linux/kernel.h> |
16 | #include <linux/signal.h> | |
17 | #include <linux/errno.h> | |
18 | #include <linux/wait.h> | |
19 | #include <linux/ptrace.h> | |
20 | #include <linux/unistd.h> | |
21 | #include <linux/stddef.h> | |
22 | #include <linux/tty.h> | |
23 | #include <linux/personality.h> | |
24 | #include <linux/suspend.h> | |
5d289964 | 25 | #include <linux/tracehook.h> |
b920de1b DH |
26 | #include <asm/cacheflush.h> |
27 | #include <asm/ucontext.h> | |
28 | #include <asm/uaccess.h> | |
29 | #include <asm/fpu.h> | |
30 | #include "sigframe.h" | |
31 | ||
32 | #define DEBUG_SIG 0 | |
33 | ||
34 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | |
35 | ||
36 | /* | |
37 | * atomically swap in the new signal mask, and wait for a signal. | |
38 | */ | |
39 | asmlinkage long sys_sigsuspend(int history0, int history1, old_sigset_t mask) | |
40 | { | |
68f3f16d AV |
41 | sigset_t blocked; |
42 | siginitset(&blocked, mask); | |
43 | return sigsuspend(&blocked); | |
b920de1b DH |
44 | } |
45 | ||
46 | /* | |
47 | * set signal action syscall | |
48 | */ | |
49 | asmlinkage long sys_sigaction(int sig, | |
50 | const struct old_sigaction __user *act, | |
51 | struct old_sigaction __user *oact) | |
52 | { | |
53 | struct k_sigaction new_ka, old_ka; | |
54 | int ret; | |
55 | ||
56 | if (act) { | |
57 | old_sigset_t mask; | |
58 | if (verify_area(VERIFY_READ, act, sizeof(*act)) || | |
59 | __get_user(new_ka.sa.sa_handler, &act->sa_handler) || | |
60bdb72e AV |
60 | __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) || |
61 | __get_user(new_ka.sa.sa_flags, &act->sa_flags) || | |
62 | __get_user(mask, &act->sa_mask)) | |
b920de1b | 63 | return -EFAULT; |
b920de1b DH |
64 | siginitset(&new_ka.sa.sa_mask, mask); |
65 | } | |
66 | ||
67 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | |
68 | ||
69 | if (!ret && oact) { | |
70 | if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) || | |
71 | __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || | |
60bdb72e AV |
72 | __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) || |
73 | __put_user(old_ka.sa.sa_flags, &oact->sa_flags) || | |
74 | __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask)) | |
b920de1b | 75 | return -EFAULT; |
b920de1b DH |
76 | } |
77 | ||
78 | return ret; | |
79 | } | |
80 | ||
81 | /* | |
82 | * set alternate signal stack syscall | |
83 | */ | |
84 | asmlinkage long sys_sigaltstack(const stack_t __user *uss, stack_t *uoss) | |
85 | { | |
7c7fcf76 | 86 | return do_sigaltstack(uss, uoss, current_frame()->sp); |
b920de1b DH |
87 | } |
88 | ||
89 | /* | |
90 | * do a signal return; undo the signal stack. | |
91 | */ | |
92 | static int restore_sigcontext(struct pt_regs *regs, | |
93 | struct sigcontext __user *sc, long *_d0) | |
94 | { | |
95 | unsigned int err = 0; | |
96 | ||
c05628b4 AV |
97 | /* Always make any pending restarted system calls return -EINTR */ |
98 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | |
99 | ||
b920de1b DH |
100 | if (is_using_fpu(current)) |
101 | fpu_kill_state(current); | |
102 | ||
103 | #define COPY(x) err |= __get_user(regs->x, &sc->x) | |
104 | COPY(d1); COPY(d2); COPY(d3); | |
105 | COPY(a0); COPY(a1); COPY(a2); COPY(a3); | |
106 | COPY(e0); COPY(e1); COPY(e2); COPY(e3); | |
107 | COPY(e4); COPY(e5); COPY(e6); COPY(e7); | |
108 | COPY(lar); COPY(lir); | |
109 | COPY(mdr); COPY(mdrq); | |
110 | COPY(mcvf); COPY(mcrl); COPY(mcrh); | |
111 | COPY(sp); COPY(pc); | |
112 | #undef COPY | |
113 | ||
114 | { | |
115 | unsigned int tmpflags; | |
116 | #ifndef CONFIG_MN10300_USING_JTAG | |
117 | #define USER_EPSW (EPSW_FLAG_Z | EPSW_FLAG_N | EPSW_FLAG_C | EPSW_FLAG_V | \ | |
118 | EPSW_T | EPSW_nAR) | |
119 | #else | |
120 | #define USER_EPSW (EPSW_FLAG_Z | EPSW_FLAG_N | EPSW_FLAG_C | EPSW_FLAG_V | \ | |
121 | EPSW_nAR) | |
122 | #endif | |
123 | err |= __get_user(tmpflags, &sc->epsw); | |
124 | regs->epsw = (regs->epsw & ~USER_EPSW) | | |
125 | (tmpflags & USER_EPSW); | |
126 | regs->orig_d0 = -1; /* disable syscall checks */ | |
127 | } | |
128 | ||
129 | { | |
130 | struct fpucontext *buf; | |
131 | err |= __get_user(buf, &sc->fpucontext); | |
132 | if (buf) { | |
133 | if (verify_area(VERIFY_READ, buf, sizeof(*buf))) | |
134 | goto badframe; | |
135 | err |= fpu_restore_sigcontext(buf); | |
136 | } | |
137 | } | |
138 | ||
139 | err |= __get_user(*_d0, &sc->d0); | |
140 | return err; | |
141 | ||
142 | badframe: | |
143 | return 1; | |
144 | } | |
145 | ||
146 | /* | |
147 | * standard signal return syscall | |
148 | */ | |
149 | asmlinkage long sys_sigreturn(void) | |
150 | { | |
7c7fcf76 | 151 | struct sigframe __user *frame; |
b920de1b DH |
152 | sigset_t set; |
153 | long d0; | |
154 | ||
7c7fcf76 | 155 | frame = (struct sigframe __user *) current_frame()->sp; |
b920de1b DH |
156 | if (verify_area(VERIFY_READ, frame, sizeof(*frame))) |
157 | goto badframe; | |
158 | if (__get_user(set.sig[0], &frame->sc.oldmask)) | |
159 | goto badframe; | |
160 | ||
161 | if (_NSIG_WORDS > 1 && | |
162 | __copy_from_user(&set.sig[1], &frame->extramask, | |
163 | sizeof(frame->extramask))) | |
164 | goto badframe; | |
165 | ||
166 | sigdelsetmask(&set, ~_BLOCKABLE); | |
00f35785 | 167 | set_current_blocked(&set); |
b920de1b | 168 | |
7c7fcf76 | 169 | if (restore_sigcontext(current_frame(), &frame->sc, &d0)) |
b920de1b DH |
170 | goto badframe; |
171 | ||
172 | return d0; | |
173 | ||
174 | badframe: | |
175 | force_sig(SIGSEGV, current); | |
176 | return 0; | |
177 | } | |
178 | ||
179 | /* | |
180 | * realtime signal return syscall | |
181 | */ | |
182 | asmlinkage long sys_rt_sigreturn(void) | |
183 | { | |
7c7fcf76 | 184 | struct rt_sigframe __user *frame; |
b920de1b | 185 | sigset_t set; |
7c7fcf76 | 186 | long d0; |
b920de1b | 187 | |
7c7fcf76 | 188 | frame = (struct rt_sigframe __user *) current_frame()->sp; |
b920de1b DH |
189 | if (verify_area(VERIFY_READ, frame, sizeof(*frame))) |
190 | goto badframe; | |
191 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | |
192 | goto badframe; | |
193 | ||
194 | sigdelsetmask(&set, ~_BLOCKABLE); | |
00f35785 | 195 | set_current_blocked(&set); |
b920de1b | 196 | |
7c7fcf76 | 197 | if (restore_sigcontext(current_frame(), &frame->uc.uc_mcontext, &d0)) |
b920de1b DH |
198 | goto badframe; |
199 | ||
7c7fcf76 DH |
200 | if (do_sigaltstack(&frame->uc.uc_stack, NULL, current_frame()->sp) == |
201 | -EFAULT) | |
b920de1b DH |
202 | goto badframe; |
203 | ||
204 | return d0; | |
205 | ||
206 | badframe: | |
207 | force_sig(SIGSEGV, current); | |
208 | return 0; | |
209 | } | |
210 | ||
211 | /* | |
212 | * store the userspace context into a signal frame | |
213 | */ | |
214 | static int setup_sigcontext(struct sigcontext __user *sc, | |
215 | struct fpucontext *fpuctx, | |
216 | struct pt_regs *regs, | |
217 | unsigned long mask) | |
218 | { | |
219 | int tmp, err = 0; | |
220 | ||
221 | #define COPY(x) err |= __put_user(regs->x, &sc->x) | |
222 | COPY(d0); COPY(d1); COPY(d2); COPY(d3); | |
223 | COPY(a0); COPY(a1); COPY(a2); COPY(a3); | |
224 | COPY(e0); COPY(e1); COPY(e2); COPY(e3); | |
225 | COPY(e4); COPY(e5); COPY(e6); COPY(e7); | |
226 | COPY(lar); COPY(lir); | |
227 | COPY(mdr); COPY(mdrq); | |
228 | COPY(mcvf); COPY(mcrl); COPY(mcrh); | |
229 | COPY(sp); COPY(epsw); COPY(pc); | |
230 | #undef COPY | |
231 | ||
232 | tmp = fpu_setup_sigcontext(fpuctx); | |
233 | if (tmp < 0) | |
234 | err = 1; | |
235 | else | |
236 | err |= __put_user(tmp ? fpuctx : NULL, &sc->fpucontext); | |
237 | ||
238 | /* non-iBCS2 extensions.. */ | |
239 | err |= __put_user(mask, &sc->oldmask); | |
240 | ||
241 | return err; | |
242 | } | |
243 | ||
244 | /* | |
245 | * determine which stack to use.. | |
246 | */ | |
247 | static inline void __user *get_sigframe(struct k_sigaction *ka, | |
248 | struct pt_regs *regs, | |
249 | size_t frame_size) | |
250 | { | |
251 | unsigned long sp; | |
252 | ||
253 | /* default to using normal stack */ | |
254 | sp = regs->sp; | |
255 | ||
256 | /* this is the X/Open sanctioned signal stack switching. */ | |
257 | if (ka->sa.sa_flags & SA_ONSTACK) { | |
4c03ee73 | 258 | if (sas_ss_flags(sp) == 0) |
b920de1b DH |
259 | sp = current->sas_ss_sp + current->sas_ss_size; |
260 | } | |
261 | ||
262 | return (void __user *) ((sp - frame_size) & ~7UL); | |
263 | } | |
264 | ||
265 | /* | |
266 | * set up a normal signal frame | |
267 | */ | |
268 | static int setup_frame(int sig, struct k_sigaction *ka, sigset_t *set, | |
269 | struct pt_regs *regs) | |
270 | { | |
271 | struct sigframe __user *frame; | |
272 | int rsig; | |
273 | ||
274 | frame = get_sigframe(ka, regs, sizeof(*frame)); | |
275 | ||
276 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | |
277 | goto give_sigsegv; | |
278 | ||
279 | rsig = sig; | |
280 | if (sig < 32 && | |
281 | current_thread_info()->exec_domain && | |
282 | current_thread_info()->exec_domain->signal_invmap) | |
283 | rsig = current_thread_info()->exec_domain->signal_invmap[sig]; | |
284 | ||
285 | if (__put_user(rsig, &frame->sig) < 0 || | |
286 | __put_user(&frame->sc, &frame->psc) < 0) | |
287 | goto give_sigsegv; | |
288 | ||
289 | if (setup_sigcontext(&frame->sc, &frame->fpuctx, regs, set->sig[0])) | |
290 | goto give_sigsegv; | |
291 | ||
292 | if (_NSIG_WORDS > 1) { | |
293 | if (__copy_to_user(frame->extramask, &set->sig[1], | |
294 | sizeof(frame->extramask))) | |
295 | goto give_sigsegv; | |
296 | } | |
297 | ||
298 | /* set up to return from userspace. If provided, use a stub already in | |
299 | * userspace */ | |
300 | if (ka->sa.sa_flags & SA_RESTORER) { | |
301 | if (__put_user(ka->sa.sa_restorer, &frame->pretcode)) | |
302 | goto give_sigsegv; | |
303 | } else { | |
304 | if (__put_user((void (*)(void))frame->retcode, | |
305 | &frame->pretcode)) | |
306 | goto give_sigsegv; | |
307 | /* this is mov $,d0; syscall 0 */ | |
308 | if (__put_user(0x2c, (char *)(frame->retcode + 0)) || | |
309 | __put_user(__NR_sigreturn, (char *)(frame->retcode + 1)) || | |
310 | __put_user(0x00, (char *)(frame->retcode + 2)) || | |
311 | __put_user(0xf0, (char *)(frame->retcode + 3)) || | |
312 | __put_user(0xe0, (char *)(frame->retcode + 4))) | |
313 | goto give_sigsegv; | |
314 | flush_icache_range((unsigned long) frame->retcode, | |
315 | (unsigned long) frame->retcode + 5); | |
316 | } | |
317 | ||
318 | /* set up registers for signal handler */ | |
319 | regs->sp = (unsigned long) frame; | |
320 | regs->pc = (unsigned long) ka->sa.sa_handler; | |
321 | regs->d0 = sig; | |
322 | regs->d1 = (unsigned long) &frame->sc; | |
323 | ||
b920de1b DH |
324 | /* the tracer may want to single-step inside the handler */ |
325 | if (test_thread_flag(TIF_SINGLESTEP)) | |
326 | ptrace_notify(SIGTRAP); | |
327 | ||
328 | #if DEBUG_SIG | |
329 | printk(KERN_DEBUG "SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n", | |
330 | sig, current->comm, current->pid, frame, regs->pc, | |
331 | frame->pretcode); | |
332 | #endif | |
333 | ||
334 | return 0; | |
335 | ||
336 | give_sigsegv: | |
e46924d2 | 337 | force_sigsegv(sig, current); |
b920de1b DH |
338 | return -EFAULT; |
339 | } | |
340 | ||
341 | /* | |
342 | * set up a realtime signal frame | |
343 | */ | |
344 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |
345 | sigset_t *set, struct pt_regs *regs) | |
346 | { | |
347 | struct rt_sigframe __user *frame; | |
348 | int rsig; | |
349 | ||
350 | frame = get_sigframe(ka, regs, sizeof(*frame)); | |
351 | ||
352 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | |
353 | goto give_sigsegv; | |
354 | ||
355 | rsig = sig; | |
356 | if (sig < 32 && | |
357 | current_thread_info()->exec_domain && | |
358 | current_thread_info()->exec_domain->signal_invmap) | |
359 | rsig = current_thread_info()->exec_domain->signal_invmap[sig]; | |
360 | ||
361 | if (__put_user(rsig, &frame->sig) || | |
362 | __put_user(&frame->info, &frame->pinfo) || | |
363 | __put_user(&frame->uc, &frame->puc) || | |
364 | copy_siginfo_to_user(&frame->info, info)) | |
365 | goto give_sigsegv; | |
366 | ||
367 | /* create the ucontext. */ | |
368 | if (__put_user(0, &frame->uc.uc_flags) || | |
369 | __put_user(0, &frame->uc.uc_link) || | |
370 | __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp) || | |
371 | __put_user(sas_ss_flags(regs->sp), &frame->uc.uc_stack.ss_flags) || | |
372 | __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size) || | |
373 | setup_sigcontext(&frame->uc.uc_mcontext, | |
374 | &frame->fpuctx, regs, set->sig[0]) || | |
375 | __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set))) | |
376 | goto give_sigsegv; | |
377 | ||
378 | /* set up to return from userspace. If provided, use a stub already in | |
379 | * userspace */ | |
380 | if (ka->sa.sa_flags & SA_RESTORER) { | |
381 | if (__put_user(ka->sa.sa_restorer, &frame->pretcode)) | |
382 | goto give_sigsegv; | |
383 | } else { | |
384 | if (__put_user((void(*)(void))frame->retcode, | |
385 | &frame->pretcode) || | |
386 | /* This is mov $,d0; syscall 0 */ | |
387 | __put_user(0x2c, (char *)(frame->retcode + 0)) || | |
388 | __put_user(__NR_rt_sigreturn, | |
389 | (char *)(frame->retcode + 1)) || | |
390 | __put_user(0x00, (char *)(frame->retcode + 2)) || | |
391 | __put_user(0xf0, (char *)(frame->retcode + 3)) || | |
392 | __put_user(0xe0, (char *)(frame->retcode + 4))) | |
393 | goto give_sigsegv; | |
394 | ||
395 | flush_icache_range((u_long) frame->retcode, | |
396 | (u_long) frame->retcode + 5); | |
397 | } | |
398 | ||
399 | /* Set up registers for signal handler */ | |
400 | regs->sp = (unsigned long) frame; | |
401 | regs->pc = (unsigned long) ka->sa.sa_handler; | |
402 | regs->d0 = sig; | |
403 | regs->d1 = (long) &frame->info; | |
404 | ||
b920de1b DH |
405 | /* the tracer may want to single-step inside the handler */ |
406 | if (test_thread_flag(TIF_SINGLESTEP)) | |
407 | ptrace_notify(SIGTRAP); | |
408 | ||
409 | #if DEBUG_SIG | |
410 | printk(KERN_DEBUG "SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n", | |
411 | sig, current->comm, current->pid, frame, regs->pc, | |
412 | frame->pretcode); | |
413 | #endif | |
414 | ||
415 | return 0; | |
416 | ||
417 | give_sigsegv: | |
e46924d2 | 418 | force_sigsegv(sig, current); |
b920de1b DH |
419 | return -EFAULT; |
420 | } | |
421 | ||
00cbf608 AV |
422 | static inline void stepback(struct pt_regs *regs) |
423 | { | |
424 | regs->pc -= 2; | |
425 | regs->orig_d0 = -1; | |
426 | } | |
427 | ||
b920de1b DH |
428 | /* |
429 | * handle the actual delivery of a signal to userspace | |
430 | */ | |
431 | static int handle_signal(int sig, | |
432 | siginfo_t *info, struct k_sigaction *ka, | |
b7f9a11a | 433 | struct pt_regs *regs) |
b920de1b | 434 | { |
b7f9a11a | 435 | sigset_t *oldset = sigmask_to_save(); |
b920de1b DH |
436 | int ret; |
437 | ||
438 | /* Are we from a system call? */ | |
439 | if (regs->orig_d0 >= 0) { | |
440 | /* If so, check system call restarting.. */ | |
441 | switch (regs->d0) { | |
442 | case -ERESTART_RESTARTBLOCK: | |
443 | case -ERESTARTNOHAND: | |
444 | regs->d0 = -EINTR; | |
445 | break; | |
446 | ||
447 | case -ERESTARTSYS: | |
448 | if (!(ka->sa.sa_flags & SA_RESTART)) { | |
449 | regs->d0 = -EINTR; | |
450 | break; | |
451 | } | |
452 | ||
453 | /* fallthrough */ | |
454 | case -ERESTARTNOINTR: | |
455 | regs->d0 = regs->orig_d0; | |
00cbf608 | 456 | stepback(regs); |
b920de1b DH |
457 | } |
458 | } | |
459 | ||
460 | /* Set up the stack frame */ | |
461 | if (ka->sa.sa_flags & SA_SIGINFO) | |
462 | ret = setup_rt_frame(sig, ka, info, oldset, regs); | |
463 | else | |
464 | ret = setup_frame(sig, ka, oldset, regs); | |
465 | ||
00f35785 MF |
466 | if (ret == 0) |
467 | block_sigmask(ka, sig); | |
b920de1b DH |
468 | |
469 | return ret; | |
470 | } | |
471 | ||
472 | /* | |
473 | * handle a potential signal | |
474 | */ | |
475 | static void do_signal(struct pt_regs *regs) | |
476 | { | |
477 | struct k_sigaction ka; | |
478 | siginfo_t info; | |
b920de1b DH |
479 | int signr; |
480 | ||
481 | /* we want the common case to go fast, which is why we may in certain | |
482 | * cases get here from kernel mode */ | |
483 | if (!user_mode(regs)) | |
484 | return; | |
485 | ||
b920de1b DH |
486 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
487 | if (signr > 0) { | |
b7f9a11a | 488 | if (handle_signal(signr, &info, &ka, regs) == 0) { |
b920de1b DH |
489 | /* a signal was successfully delivered; the saved |
490 | * sigmask will have been stored in the signal frame, | |
491 | * and will be restored by sigreturn, so we can simply | |
492 | * clear the TIF_RESTORE_SIGMASK flag */ | |
493 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | |
494 | clear_thread_flag(TIF_RESTORE_SIGMASK); | |
5d289964 DH |
495 | |
496 | tracehook_signal_handler(signr, &info, &ka, regs, | |
497 | test_thread_flag(TIF_SINGLESTEP)); | |
b920de1b DH |
498 | } |
499 | ||
500 | return; | |
501 | } | |
502 | ||
503 | /* did we come from a system call? */ | |
504 | if (regs->orig_d0 >= 0) { | |
505 | /* restart the system call - no handlers present */ | |
506 | switch (regs->d0) { | |
507 | case -ERESTARTNOHAND: | |
508 | case -ERESTARTSYS: | |
509 | case -ERESTARTNOINTR: | |
510 | regs->d0 = regs->orig_d0; | |
00cbf608 | 511 | stepback(regs); |
b920de1b DH |
512 | break; |
513 | ||
514 | case -ERESTART_RESTARTBLOCK: | |
515 | regs->d0 = __NR_restart_syscall; | |
00cbf608 | 516 | stepback(regs); |
b920de1b DH |
517 | break; |
518 | } | |
519 | } | |
520 | ||
521 | /* if there's no signal to deliver, we just put the saved sigmask | |
522 | * back */ | |
51a7b448 | 523 | restore_saved_sigmask(); |
b920de1b DH |
524 | } |
525 | ||
526 | /* | |
527 | * notification of userspace execution resumption | |
528 | * - triggered by current->work.notify_resume | |
529 | */ | |
530 | asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags) | |
531 | { | |
532 | /* Pending single-step? */ | |
533 | if (thread_info_flags & _TIF_SINGLESTEP) { | |
534 | #ifndef CONFIG_MN10300_USING_JTAG | |
535 | regs->epsw |= EPSW_T; | |
536 | clear_thread_flag(TIF_SINGLESTEP); | |
537 | #else | |
538 | BUG(); /* no h/w single-step if using JTAG unit */ | |
539 | #endif | |
540 | } | |
541 | ||
542 | /* deal with pending signal delivery */ | |
543 | if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) | |
544 | do_signal(regs); | |
5d289964 DH |
545 | |
546 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | |
547 | clear_thread_flag(TIF_NOTIFY_RESUME); | |
7c7fcf76 | 548 | tracehook_notify_resume(current_frame()); |
5d289964 | 549 | } |
b920de1b | 550 | } |