11 #include <linux/sched.h>
14 #include <linux/kernel.h>
15 #include <linux/signal.h>
16 #include <linux/errno.h>
17 #include <linux/wait.h>
18 #include <linux/ptrace.h>
20 #include <linux/stddef.h>
21 #include <linux/tty.h>
22 #include <linux/elf.h>
23 #include <linux/personality.h>
24 #include <linux/binfmts.h>
27 #include <asm/ucontext.h>
28 #include <asm/uaccess.h>
29 #include <asm/pgtable.h>
30 #include <asm/cacheflush.h>
31 #include <asm/syscalls.h>
47 #define UNWINDGUARD 64
56 siginitset(&blocked, mask);
75 siginitset(&new_ka.
sa.sa_mask, mask);
94 unsigned long r6,
unsigned long r7,
107 #define MOVW(n) (0x9300|((n)-2))
108 #if defined(CONFIG_CPU_SH2)
109 #define TRAP_NOARG 0xc320
111 #define TRAP_NOARG 0xc310
113 #define OR_R0_R0 0x200b
130 static inline int restore_sigcontext_fpu(
struct sigcontext __user *
sc)
139 sizeof(
long)*(16*2+2));
142 static inline int save_sigcontext_fpu(
struct sigcontext __user *
sc,
163 sizeof(
long)*(16*2+2));
170 unsigned int err = 0;
172 #define COPY(x) err |= __get_user(regs->x, &sc->sc_##x)
192 clear_fpu(tsk, regs);
194 err |=
__get_user (owned_fp, &sc->sc_ownedfp);
196 err |= restore_sigcontext_fpu(sc);
206 unsigned long r6,
unsigned long r7,
238 unsigned long r6,
unsigned long r7,
281 #define COPY(x) err |= __put_user(regs->x, &sc->sc_##x)
296 err |= save_sigcontext_fpu(sc, regs);
308 static inline void __user *
312 if (sas_ss_flags(sp) == 0)
316 return (
void __user *)((sp - (frame_size+
UNWINDGUARD)) & -8ul);
351 regs->
pr = (
unsigned long) ka->
sa.sa_restorer;
352 #ifdef CONFIG_VSYSCALL
354 regs->
pr = VDSO_SYM(&__kernel_sigreturn);
374 regs->
regs[15] = (
unsigned long) frame;
375 regs->
regs[4] = signal;
386 regs->
pc = (
unsigned long)ka->
sa.sa_handler;
393 pr_debug(
"SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n",
427 &frame->
uc.uc_stack.ss_sp);
429 &frame->
uc.uc_stack.ss_flags);
438 regs->
pr = (
unsigned long) ka->
sa.sa_restorer;
439 #ifdef CONFIG_VSYSCALL
441 regs->
pr = VDSO_SYM(&__kernel_rt_sigreturn);
461 regs->
regs[15] = (
unsigned long) frame;
462 regs->
regs[4] = signal;
464 regs->
regs[6] = (
unsigned long) &frame->
uc;
473 regs->
pc = (
unsigned long)ka->
sa.sa_handler;
480 pr_debug(
"SIG deliver (%s:%d): sp=%p pc=%08lx pr=%08lx\n",
491 handle_syscall_restart(
unsigned long save_r0,
struct pt_regs *regs,
499 switch (regs->
regs[0]) {
502 no_system_call_restart:
508 goto no_system_call_restart;
511 regs->
regs[0] = save_r0;
522 struct pt_regs *regs,
unsigned int save_r0)
524 sigset_t *oldset = sigmask_to_save();
529 ret = setup_rt_frame(sig, ka, info, oldset, regs);
531 ret = setup_frame(sig, ka, oldset, regs);
565 handle_syscall_restart(save_r0, regs, &ka.
sa);
568 handle_signal(signr, &ka, &info, regs, save_r0);
573 if (regs->
tra >= 0) {
578 regs->
regs[0] = save_r0;
590 restore_saved_sigmask();
594 unsigned long thread_info_flags)
602 tracehook_notify_resume(regs);