13 #include <linux/sched.h>
15 #include <linux/errno.h>
16 #include <linux/ptrace.h>
20 #include <asm/uaccess.h>
21 #include <asm/ucontext.h>
22 #include <asm/syscalls.h>
42 #define COPY(x) err |= __get_user(regs->x, &sc->x)
66 err |= !valid_user_regs(regs);
81 pr_debug(
"SIG return: frame = %p\n", frame);
91 if (restore_sigcontext(regs, &frame->
uc.uc_mcontext))
97 pr_debug(
"Context restored: pc = %08lx, lr = %08lx, sp = %08lx\n",
98 regs->
pc, regs->
lr, regs->
sp);
112 #define COPY(x) err |= __put_user(regs->x, &sc->x)
135 static inline void __user *
138 unsigned long sp = regs->
sp;
140 if ((ka->
sa.sa_flags &
SA_ONSTACK) && !sas_ss_flags(sp))
143 return (
void __user *)((sp - framesize) & ~3);
153 frame = get_sigframe(ka, regs,
sizeof(*frame));
167 #if __NR_rt_sigreturn > 127
168 # error __NR_rt_sigreturn must be < 127 to fit in a short mov
179 &frame->
uc.uc_stack.ss_sp);
181 &frame->
uc.uc_stack.ss_flags);
183 &frame->
uc.uc_stack.ss_size);
184 err |= setup_sigcontext(&frame->
uc.uc_mcontext, regs);
192 regs->
r10 = (
unsigned long) &frame->
uc;
193 regs->
sp = (
unsigned long) frame;
195 regs->
lr = (
unsigned long)ka->
sa.sa_restorer;
202 pr_debug(
"SIG deliver [%s:%d]: sig=%d sp=0x%lx pc=0x%lx->0x%p lr=0x%lx\n",
204 regs->
pc, ka->
sa.sa_handler, regs->
lr);
206 regs->
pc = (
unsigned long) ka->
sa.sa_handler;
212 static inline void setup_syscall_restart(
struct pt_regs *regs)
230 ret = setup_rt_frame(sig, ka, info, sigmask_to_save(), regs);
235 ret |= !valid_user_regs(regs);
251 static void do_signal(
struct pt_regs *regs,
int syscall)
282 setup_syscall_restart(regs);
288 restore_saved_sigmask();
292 handle_signal(signr, &ka, &info, regs, syscall);
303 do_signal(regs, syscall);
307 tracehook_notify_resume(regs);