aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/signal_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/signal_32.c')
-rw-r--r--arch/sh/kernel/signal_32.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index f311551d9a05..46170a9a7221 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -33,6 +33,11 @@
33 33
34#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 34#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
35 35
36struct fdpic_func_descriptor {
37 unsigned long text;
38 unsigned long GOT;
39};
40
36/* 41/*
37 * Atomically swap in the new signal mask, and wait for a signal. 42 * Atomically swap in the new signal mask, and wait for a signal.
38 */ 43 */
@@ -378,7 +383,15 @@ static int setup_frame(int sig, struct k_sigaction *ka,
378 regs->regs[4] = signal; /* Arg for signal handler */ 383 regs->regs[4] = signal; /* Arg for signal handler */
379 regs->regs[5] = 0; 384 regs->regs[5] = 0;
380 regs->regs[6] = (unsigned long) &frame->sc; 385 regs->regs[6] = (unsigned long) &frame->sc;
381 regs->pc = (unsigned long) ka->sa.sa_handler; 386
387 if (current->personality & FDPIC_FUNCPTRS) {
388 struct fdpic_func_descriptor __user *funcptr =
389 (struct fdpic_func_descriptor __user *)ka->sa.sa_handler;
390
391 __get_user(regs->pc, &funcptr->text);
392 __get_user(regs->regs[12], &funcptr->GOT);
393 } else
394 regs->pc = (unsigned long)ka->sa.sa_handler;
382 395
383 set_fs(USER_DS); 396 set_fs(USER_DS);
384 397
@@ -458,7 +471,15 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
458 regs->regs[4] = signal; /* Arg for signal handler */ 471 regs->regs[4] = signal; /* Arg for signal handler */
459 regs->regs[5] = (unsigned long) &frame->info; 472 regs->regs[5] = (unsigned long) &frame->info;
460 regs->regs[6] = (unsigned long) &frame->uc; 473 regs->regs[6] = (unsigned long) &frame->uc;
461 regs->pc = (unsigned long) ka->sa.sa_handler; 474
475 if (current->personality & FDPIC_FUNCPTRS) {
476 struct fdpic_func_descriptor __user *funcptr =
477 (struct fdpic_func_descriptor __user *)ka->sa.sa_handler;
478
479 __get_user(regs->pc, &funcptr->text);
480 __get_user(regs->regs[12], &funcptr->GOT);
481 } else
482 regs->pc = (unsigned long)ka->sa.sa_handler;
462 483
463 set_fs(USER_DS); 484 set_fs(USER_DS);
464 485