12 #include <linux/sched.h>
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>
21 #include <linux/stddef.h>
22 #include <linux/tty.h>
23 #include <linux/personality.h>
24 #include <linux/binfmts.h>
28 #include <asm/ucontext.h>
29 #include <asm/uaccess.h>
31 #include <asm/switch_to.h>
57 siginitset(&blocked,
mask);
75 siginitset(&new_ka.
sa.sa_mask, mask);
104 save_access_regs(
current->thread.acrs);
113 sizeof(sregs->regs.acrs));
118 save_fp_regs(&
current->thread.fp_regs);
125 static int restore_sigregs(
struct pt_regs *regs,
_sigregs __user *sregs)
149 sizeof(sregs->regs.acrs));
150 restore_access_regs(
current->thread.acrs);
156 restore_fp_regs(&
current->thread.fp_regs);
172 if (restore_sigregs(regs, &frame->sregs))
174 return regs->
gprs[2];
191 if (restore_sigregs(regs, &frame->uc.uc_mcontext))
196 return regs->
gprs[2];
210 static inline void __user *
219 if (on_sig_stack(sp) && !on_sig_stack((sp - frame_size) & -8
UL))
220 return (
void __user *) -1
UL;
224 if (! sas_ss_flags(sp))
228 return (
void __user *)((sp - frame_size) & -8ul);
231 static inline int map_signal(
int sig)
241 static int setup_frame(
int sig,
struct k_sigaction *ka,
250 if (frame == (
void __user *) -1
UL)
256 if (save_sigregs(regs, &frame->sregs))
258 if (
__put_user(&frame->sregs, &frame->sc.sregs))
270 (
u16 __user *)(frame->retcode)))
279 regs->
gprs[15] = (
unsigned long) frame;
286 regs->
gprs[2] = map_signal(sig);
287 regs->
gprs[3] = (
unsigned long) &frame->sc;
319 if (frame == (
void __user *) -1
UL)
330 &frame->uc.uc_stack.ss_flags);
332 err |= save_sigregs(regs, &frame->uc.uc_mcontext);
346 (
u16 __user *)(frame->retcode)))
355 regs->
gprs[15] = (
unsigned long) frame;
362 regs->
gprs[2] = map_signal(sig);
363 regs->
gprs[3] = (
unsigned long) &frame->info;
364 regs->
gprs[4] = (
unsigned long) &frame->uc;
373 static void handle_signal(
unsigned long sig,
struct k_sigaction *ka,
381 ret = setup_rt_frame(sig, ka, info, oldset, regs);
383 ret = setup_frame(sig, ka, oldset, regs);
404 sigset_t *oldset = sigmask_to_save();
420 switch (regs->
gprs[2]) {
434 __rewind_psw(regs->
psw,
445 handle_signal(signr, &ka, &info, oldset, regs);
453 switch (regs->
gprs[2]) {
471 restore_saved_sigmask();
477 tracehook_notify_resume(regs);