9 #include <linux/sched.h>
10 #include <linux/kernel.h>
11 #include <linux/signal.h>
12 #include <linux/errno.h>
13 #include <linux/wait.h>
14 #include <linux/ptrace.h>
17 #include <linux/tty.h>
19 #include <linux/binfmts.h>
20 #include <linux/bitops.h>
23 #include <asm/uaccess.h>
24 #include <asm/ptrace.h>
25 #include <asm/pgalloc.h>
26 #include <asm/pgtable.h>
27 #include <asm/cacheflush.h>
28 #include <asm/switch_to.h>
32 extern void fpsave(
unsigned long *fpregs,
unsigned long *fsr,
33 void *fpqueue,
unsigned long *fpqdepth);
34 extern void fpload(
unsigned long *fpregs,
unsigned long *fsr);
59 #define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7)))
60 #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7)))
65 siginitset(&blocked,
set);
71 return _sigpause_common(
set);
77 unsigned long up_psr,
pc, npc;
94 if (((
unsigned long) sf) & 3)
112 pt_regs_clear_syscall(regs);
141 unsigned int psr,
pc, npc;
152 (((
unsigned long) sf) & 0x03))
157 err |= ((pc | npc) & 0x03);
168 pt_regs_clear_syscall(regs);
171 if (!err && fpu_save)
192 if (!err && rwin_save) {
204 static inline int invalid_frame_pointer(
void __user *
fp,
int fplen)
206 if ((((
unsigned long) fp) & 7) || !
__access_ok((
unsigned long)fp, fplen))
220 if (on_sig_stack(sp) && !
likely(on_sig_stack(sp - framesize)))
221 return (
void __user *) -1
L;
225 if (sas_ss_flags(sp) == 0)
239 return (
void __user *)
sp;
246 int sigframe_size,
err, wsaved;
254 sigframe_size =
sizeof(*sf);
263 if (invalid_frame_pointer(sf, sigframe_size))
264 goto sigill_and_return;
283 tail +=
sizeof(*rwp);
312 regs->
pc = (
unsigned long) ka->
sa.sa_handler;
313 regs->
npc = (regs->
pc + 4);
319 regs->
u_regs[
UREG_I7] = (
unsigned long)(&(sf->insns[0]) - 2);
347 int sigframe_size, wsaved;
354 sigframe_size =
sizeof(*sf);
361 if (invalid_frame_pointer(sf, sigframe_size))
385 tail +=
sizeof(*rwp);
418 regs->
pc = (
unsigned long) ka->
sa.sa_handler;
419 regs->
npc = (regs->
pc + 4);
449 handle_signal(
unsigned long signr,
struct k_sigaction *ka,
452 sigset_t *oldset = sigmask_to_save();
456 err = setup_rt_frame(ka, regs, signr, oldset, info);
458 err = setup_frame(ka, regs, signr, oldset);
466 static inline void syscall_restart(
unsigned long orig_i0,
struct pt_regs *regs,
472 no_system_call_restart:
478 goto no_system_call_restart;
516 if (pt_regs_is_syscall(regs) && (regs->
psr &
PSR_C))
526 if (pt_regs_is_syscall(regs) && (regs->
psr &
PSR_C)) {
534 syscall_restart(orig_i0, regs, &ka.
sa);
535 handle_signal(signr, &ka, &info, regs);
538 if (restart_syscall &&
546 pt_regs_clear_syscall(regs);
548 if (restart_syscall &&
553 pt_regs_clear_syscall(regs);
559 restore_saved_sigmask();
563 unsigned long thread_info_flags)
569 tracehook_notify_resume(regs);
582 &ossptr->the_stack) ||
583 __put_user(on_sig_stack(sp), &ossptr->cur_status))
591 if (
get_user(ss_sp, &ssptr->the_stack))
596 if (
current->sas_ss_sp && on_sig_stack(sp))