18 #include <linux/sched.h>
21 #include <linux/kernel.h>
22 #include <linux/signal.h>
23 #include <linux/errno.h>
24 #include <linux/wait.h>
25 #include <linux/ptrace.h>
27 #include <linux/stddef.h>
30 #include <asm/processor.h>
31 #include <asm/ucontext.h>
32 #include <asm/uaccess.h>
93 if (((
long)frame) & 3)
111 return regs->
gpr[11];
140 static inline unsigned long align_sigframe(
unsigned long sp)
151 struct pt_regs *regs,
size_t frame_size)
153 unsigned long sp = regs->
sp;
154 int onsigstack = on_sig_stack(sp);
165 sp = align_sigframe(sp - frame_size);
171 if (onsigstack && !
likely(on_sig_stack(sp)))
172 return (
void __user *)-1
L;
174 return (
void __user *)
sp;
188 unsigned long return_ip;
209 &frame->
uc.uc_stack.ss_sp);
210 err |=
__put_user(sas_ss_flags(regs->
sp), &frame->
uc.uc_stack.ss_flags);
233 regs->
pc = (
unsigned long)ka->
sa.sa_handler;
234 regs->
gpr[9] = (
unsigned long)return_ip;
235 regs->
gpr[3] = (
unsigned long)sig;
237 regs->
gpr[5] = (
unsigned long)&frame->
uc;
240 regs->
sp = (
unsigned long)frame;
250 handle_signal(
unsigned long sig,
256 ret = setup_rt_frame(sig, ka, info, sigmask_to_save(), regs);
305 switch (regs->
gpr[11]) {
309 restart = (signr <= 0);
314 restart = (signr <= 0 || (ka.
sa.sa_flags &
SA_RESTART));
336 restore_saved_sigmask();
339 handle_signal(signr, &info, &ka, regs);
352 tracehook_notify_resume(regs);