13 #include <linux/sched.h>
16 #include <linux/kernel.h>
17 #include <linux/signal.h>
18 #include <linux/errno.h>
19 #include <linux/wait.h>
20 #include <linux/ptrace.h>
22 #include <linux/personality.h>
24 #include <asm/ucontext.h>
25 #include <asm/uaccess.h>
26 #include <asm/cacheflush.h>
41 siginitset(&blocked, mask);
60 siginitset(&new_ka.
sa.sa_mask, mask);
108 static int restore_sigcontext(
struct sigcontext __user *
sc,
int *_gr8)
118 if (
copy_from_user(user, &sc->sc_context,
sizeof(sc->sc_context)))
125 user->
i.syscallno = -1;
127 *_gr8 = user->
i.gr[8];
151 if (restore_sigcontext(&frame->
sc, &
gr8))
173 if (restore_sigcontext(&frame->
uc.uc_mcontext, &
gr8))
189 static int setup_sigcontext(
struct sigcontext __user *
sc,
unsigned long mask)
220 if (! sas_ss_flags(sp))
224 return (
void __user *) ((sp - frame_size) & ~7
UL);
239 frame = get_sigframe(ka,
sizeof(*frame));
246 __current_thread_info->exec_domain &&
247 __current_thread_info->exec_domain->signal_invmap)
248 rsig = __current_thread_info->exec_domain->signal_invmap[
sig];
253 if (setup_sigcontext(&frame->
sc,
set->sig[0]))
279 (
unsigned long) (frame->
retcode + 2));
289 __frame->pc =
desc.text;
290 __frame->gr15 =
desc.GOT;
292 __frame->pc = (
unsigned long) ka->
sa.sa_handler;
296 __frame->sp = (
unsigned long) frame;
301 printk(
"SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n",
326 frame = get_sigframe(ka,
sizeof(*frame));
333 __current_thread_info->exec_domain &&
334 __current_thread_info->exec_domain->signal_invmap)
335 rsig = __current_thread_info->exec_domain->signal_invmap[
sig];
349 __put_user(sas_ss_flags(__frame->sp), &frame->
uc.uc_stack.ss_flags) ||
353 if (setup_sigcontext(&frame->
uc.uc_mcontext,
set->sig[0]))
376 (
unsigned long) (frame->
retcode + 2));
386 __frame->pc =
desc.text;
387 __frame->gr15 =
desc.GOT;
389 __frame->pc = (
unsigned long) ka->
sa.sa_handler;
393 __frame->sp = (
unsigned long) frame;
396 __frame->gr9 = (
unsigned long) &frame->
info;
399 printk(
"SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n",
416 static void handle_signal(
unsigned long sig,
siginfo_t *info,
419 sigset_t *oldset = sigmask_to_save();
423 if (__frame->syscallno != -1) {
425 switch (__frame->gr8) {
428 __frame->gr8 = -
EINTR;
433 __frame->gr8 = -
EINTR;
439 __frame->gr8 = __frame->orig_gr8;
442 __frame->syscallno = -1;
447 ret = setup_rt_frame(sig, ka, info, oldset);
449 ret = setup_frame(sig, ka, oldset);
472 handle_signal(signr, &info, &ka);
477 if (__frame->syscallno != -1) {
479 switch (__frame->gr8) {
483 __frame->gr8 = __frame->orig_gr8;
492 __frame->syscallno = -1;
497 restore_saved_sigmask();
518 tracehook_notify_resume(__frame);