diff options
Diffstat (limited to 'arch/cris/arch-v32/kernel/signal.c')
-rw-r--r-- | arch/cris/arch-v32/kernel/signal.c | 68 |
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 { | |||
51 | void do_signal(int restart, struct pt_regs *regs); | 51 | void do_signal(int restart, struct pt_regs *regs); |
52 | void keep_debug_flags(unsigned long oldccs, unsigned long oldspc, | 52 | void 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 | */ | ||
58 | int | ||
59 | sys_sigsuspend(old_sigset_t mask) | ||
60 | { | ||
61 | sigset_t blocked; | ||
62 | siginitset(&blocked, mask); | ||
63 | return sigsuspend(&blocked); | ||
64 | } | ||
65 | |||
66 | int | ||
67 | sys_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 | |||
102 | int | ||
103 | sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) | ||
104 | { | ||
105 | return do_sigaltstack(uss, uoss, rdusp()); | ||
106 | } | ||
107 | 54 | ||
108 | static int | 55 | static int |
109 | restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | 56 | restore_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. */ | 85 | asmlinkage int sys_sigreturn(void) |
139 | asmlinkage int | ||
140 | sys_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. */ | 126 | asmlinkage int sys_rt_sigreturn(void) |
182 | asmlinkage int | ||
183 | sys_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; |