aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/kernel/signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v32/kernel/signal.c')
-rw-r--r--arch/cris/arch-v32/kernel/signal.c68
1 files changed, 6 insertions, 62 deletions
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index b60d1b65a426..01d1375c9004 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -51,59 +51,6 @@ struct rt_signal_frame {
51void do_signal(int restart, struct pt_regs *regs); 51void do_signal(int restart, struct pt_regs *regs);
52void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, 52void keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
53 struct pt_regs *regs); 53 struct pt_regs *regs);
54/*
55 * Swap in the new signal mask, and wait for a signal. Define some
56 * dummy arguments to be able to reach the regs argument.
57 */
58int
59sys_sigsuspend(old_sigset_t mask)
60{
61 sigset_t blocked;
62 siginitset(&blocked, mask);
63 return sigsuspend(&blocked);
64}
65
66int
67sys_sigaction(int signal, const struct old_sigaction *act,
68 struct old_sigaction *oact)
69{
70 int retval;
71 struct k_sigaction newk;
72 struct k_sigaction oldk;
73
74 if (act) {
75 old_sigset_t mask;
76
77 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
78 __get_user(newk.sa.sa_handler, &act->sa_handler) ||
79 __get_user(newk.sa.sa_restorer, &act->sa_restorer) ||
80 __get_user(newk.sa.sa_flags, &act->sa_flags) ||
81 __get_user(mask, &act->sa_mask))
82 return -EFAULT;
83
84 siginitset(&newk.sa.sa_mask, mask);
85 }
86
87 retval = do_sigaction(signal, act ? &newk : NULL, oact ? &oldk : NULL);
88
89 if (!retval && oact) {
90 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
91 __put_user(oldk.sa.sa_handler, &oact->sa_handler) ||
92 __put_user(oldk.sa.sa_restorer, &oact->sa_restorer) ||
93 __put_user(oldk.sa.sa_flags, &oact->sa_flags) ||
94 __put_user(oldk.sa.sa_mask.sig[0], &oact->sa_mask))
95 return -EFAULT;
96
97 }
98
99 return retval;
100}
101
102int
103sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
104{
105 return do_sigaltstack(uss, uoss, rdusp());
106}
107 54
108static int 55static int
109restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) 56restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
@@ -135,11 +82,9 @@ badframe:
135 return 1; 82 return 1;
136} 83}
137 84
138/* Define some dummy arguments to be able to reach the regs argument. */ 85asmlinkage int sys_sigreturn(void)
139asmlinkage int
140sys_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
141 struct pt_regs *regs)
142{ 86{
87 struct pt_regs *regs = current_pt_regs();
143 sigset_t set; 88 sigset_t set;
144 struct signal_frame __user *frame; 89 struct signal_frame __user *frame;
145 unsigned long oldspc = regs->spc; 90 unsigned long oldspc = regs->spc;
@@ -178,11 +123,9 @@ badframe:
178 return 0; 123 return 0;
179} 124}
180 125
181/* Define some dummy variables to be able to reach the regs argument. */ 126asmlinkage int sys_rt_sigreturn(void)
182asmlinkage int
183sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
184 struct pt_regs *regs)
185{ 127{
128 struct pt_regs *regs = current_pt_regs();
186 sigset_t set; 129 sigset_t set;
187 struct rt_signal_frame __user *frame; 130 struct rt_signal_frame __user *frame;
188 unsigned long oldspc = regs->spc; 131 unsigned long oldspc = regs->spc;
@@ -209,7 +152,7 @@ sys_rt_sigreturn(long r10, long r11, long r12, long r13, long mof, long srp,
209 if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) 152 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
210 goto badframe; 153 goto badframe;
211 154
212 if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT) 155 if (restore_altstack(&frame->uc.uc_stack))
213 goto badframe; 156 goto badframe;
214 157
215 keep_debug_flags(oldccs, oldspc, regs); 158 keep_debug_flags(oldccs, oldspc, regs);
@@ -371,6 +314,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
371 err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext)); 314 err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
372 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); 315 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
373 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 316 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
317 err |= __save_altstack(&frame->uc.uc_stack, rdusp());
374 318
375 if (err) 319 if (err)
376 goto give_sigsegv; 320 goto give_sigsegv;