aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2013-10-06 15:57:10 -0400
committerRichard Weinberger <richard@sigma-star.at>2014-08-06 07:03:41 -0400
commit307627eebbb0bc41b21e74d78b932362a6c1b38d (patch)
treee50bcf71b27a6eb237522e244d5cae8f2ce16c70 /arch/um
parentb3707c7ed013d36752272ca2f9ed20dc8aed92e4 (diff)
um: Use get_signal() signal_setup_done()
Use the more generic functions get_signal() signal_setup_done() for signal delivery. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/include/shared/frame_kern.h12
-rw-r--r--arch/um/kernel/signal.c27
2 files changed, 15 insertions, 24 deletions
diff --git a/arch/um/include/shared/frame_kern.h b/arch/um/include/shared/frame_kern.h
index f2ca5702a4e2..a5cde5c433b4 100644
--- a/arch/um/include/shared/frame_kern.h
+++ b/arch/um/include/shared/frame_kern.h
@@ -6,14 +6,10 @@
6#ifndef __FRAME_KERN_H_ 6#ifndef __FRAME_KERN_H_
7#define __FRAME_KERN_H_ 7#define __FRAME_KERN_H_
8 8
9extern int setup_signal_stack_sc(unsigned long stack_top, int sig, 9extern int setup_signal_stack_sc(unsigned long stack_top, struct ksignal *ksig,
10 struct k_sigaction *ka, 10 struct pt_regs *regs, sigset_t *mask);
11 struct pt_regs *regs, 11extern int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
12 sigset_t *mask); 12 struct pt_regs *regs, sigset_t *mask);
13extern int setup_signal_stack_si(unsigned long stack_top, int sig,
14 struct k_sigaction *ka,
15 struct pt_regs *regs, struct siginfo *info,
16 sigset_t *mask);
17 13
18#endif 14#endif
19 15
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c
index f57e02e7910f..4f60e4aad790 100644
--- a/arch/um/kernel/signal.c
+++ b/arch/um/kernel/signal.c
@@ -18,8 +18,7 @@ EXPORT_SYMBOL(unblock_signals);
18/* 18/*
19 * OK, we're invoking a handler 19 * OK, we're invoking a handler
20 */ 20 */
21static void handle_signal(struct pt_regs *regs, unsigned long signr, 21static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
22 struct k_sigaction *ka, struct siginfo *info)
23{ 22{
24 sigset_t *oldset = sigmask_to_save(); 23 sigset_t *oldset = sigmask_to_save();
25 int singlestep = 0; 24 int singlestep = 0;
@@ -39,7 +38,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
39 break; 38 break;
40 39
41 case -ERESTARTSYS: 40 case -ERESTARTSYS:
42 if (!(ka->sa.sa_flags & SA_RESTART)) { 41 if (!(ksig->ka.sa.sa_flags & SA_RESTART)) {
43 PT_REGS_SYSCALL_RET(regs) = -EINTR; 42 PT_REGS_SYSCALL_RET(regs) = -EINTR;
44 break; 43 break;
45 } 44 }
@@ -52,32 +51,28 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
52 } 51 }
53 52
54 sp = PT_REGS_SP(regs); 53 sp = PT_REGS_SP(regs);
55 if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0)) 54 if ((ksig->ka.sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0))
56 sp = current->sas_ss_sp + current->sas_ss_size; 55 sp = current->sas_ss_sp + current->sas_ss_size;
57 56
58#ifdef CONFIG_ARCH_HAS_SC_SIGNALS 57#ifdef CONFIG_ARCH_HAS_SC_SIGNALS
59 if (!(ka->sa.sa_flags & SA_SIGINFO)) 58 if (!(ksig->ka.sa.sa_flags & SA_SIGINFO))
60 err = setup_signal_stack_sc(sp, signr, ka, regs, oldset); 59 err = setup_signal_stack_sc(sp, ksig, regs, oldset);
61 else 60 else
62#endif 61#endif
63 err = setup_signal_stack_si(sp, signr, ka, regs, info, oldset); 62 err = setup_signal_stack_si(sp, ksig, regs, oldset);
64 63
65 if (err) 64 signal_setup_done(err, ksig, singlestep);
66 force_sigsegv(signr, current);
67 else
68 signal_delivered(signr, info, ka, regs, singlestep);
69} 65}
70 66
71static int kern_do_signal(struct pt_regs *regs) 67static int kern_do_signal(struct pt_regs *regs)
72{ 68{
73 struct k_sigaction ka_copy; 69 struct ksignal ksig;
74 struct siginfo info; 70 int handled_sig = 0;
75 int sig, handled_sig = 0;
76 71
77 while ((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0) { 72 while (get_signal(&ksig)) {
78 handled_sig = 1; 73 handled_sig = 1;
79 /* Whee! Actually deliver the signal. */ 74 /* Whee! Actually deliver the signal. */
80 handle_signal(regs, sig, &ka_copy, &info); 75 handle_signal(&ksig, regs);
81 } 76 }
82 77
83 /* Did we come from a system call? */ 78 /* Did we come from a system call? */