diff options
Diffstat (limited to 'arch/blackfin/kernel/signal.c')
-rw-r--r-- | arch/blackfin/kernel/signal.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c index e0fd63e9e38a..d536f35d1f43 100644 --- a/arch/blackfin/kernel/signal.c +++ b/arch/blackfin/kernel/signal.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2004-2009 Analog Devices Inc. | 2 | * Copyright 2004-2010 Analog Devices Inc. |
3 | * | 3 | * |
4 | * Licensed under the GPL-2 or later | 4 | * Licensed under the GPL-2 or later |
5 | */ | 5 | */ |
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/cacheflush.h> | 17 | #include <asm/cacheflush.h> |
18 | #include <asm/ucontext.h> | 18 | #include <asm/ucontext.h> |
19 | #include <asm/fixed_code.h> | 19 | #include <asm/fixed_code.h> |
20 | #include <asm/syscall.h> | ||
20 | 21 | ||
21 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 22 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
22 | 23 | ||
@@ -50,6 +51,9 @@ rt_restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *p | |||
50 | unsigned long usp = 0; | 51 | unsigned long usp = 0; |
51 | int err = 0; | 52 | int err = 0; |
52 | 53 | ||
54 | /* Always make any pending restarted system calls return -EINTR */ | ||
55 | current_thread_info()->restart_block.fn = do_no_restart_syscall; | ||
56 | |||
53 | #define RESTORE(x) err |= __get_user(regs->x, &sc->sc_##x) | 57 | #define RESTORE(x) err |= __get_user(regs->x, &sc->sc_##x) |
54 | 58 | ||
55 | /* restore passed registers */ | 59 | /* restore passed registers */ |
@@ -206,16 +210,6 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info, | |||
206 | regs->r1 = (unsigned long)(&frame->info); | 210 | regs->r1 = (unsigned long)(&frame->info); |
207 | regs->r2 = (unsigned long)(&frame->uc); | 211 | regs->r2 = (unsigned long)(&frame->uc); |
208 | 212 | ||
209 | /* | ||
210 | * Clear the trace flag when entering the signal handler, but | ||
211 | * notify any tracer that was single-stepping it. The tracer | ||
212 | * may want to single-step inside the handler too. | ||
213 | */ | ||
214 | if (regs->syscfg & TRACE_BITS) { | ||
215 | regs->syscfg &= ~TRACE_BITS; | ||
216 | ptrace_notify(SIGTRAP); | ||
217 | } | ||
218 | |||
219 | return 0; | 213 | return 0; |
220 | 214 | ||
221 | give_sigsegv: | 215 | give_sigsegv: |
@@ -247,6 +241,11 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) | |||
247 | regs->r0 = regs->orig_r0; | 241 | regs->r0 = regs->orig_r0; |
248 | regs->pc -= 2; | 242 | regs->pc -= 2; |
249 | break; | 243 | break; |
244 | |||
245 | case -ERESTART_RESTARTBLOCK: | ||
246 | regs->p0 = __NR_restart_syscall; | ||
247 | regs->pc -= 2; | ||
248 | break; | ||
250 | } | 249 | } |
251 | } | 250 | } |
252 | 251 | ||
@@ -315,6 +314,9 @@ asmlinkage void do_signal(struct pt_regs *regs) | |||
315 | * clear the TIF_RESTORE_SIGMASK flag */ | 314 | * clear the TIF_RESTORE_SIGMASK flag */ |
316 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) | 315 | if (test_thread_flag(TIF_RESTORE_SIGMASK)) |
317 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 316 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
317 | |||
318 | tracehook_signal_handler(signr, &info, &ka, regs, | ||
319 | test_thread_flag(TIF_SINGLESTEP)); | ||
318 | } | 320 | } |
319 | 321 | ||
320 | return; | 322 | return; |