[PATCH] [v850] Pass extra signal handler args correctly on the v850

Miles Bader (miles@lsi.nec.co.jp)
Thu, 19 Dec 2002 11:43:27 +0900 (JST)


The old code seems completely wrong; I guess it was just left over from
whichever architecture this code was copied from.

diff -ruN -X../cludes ../orig/linux-2.5.52-uc0/arch/v850/kernel/signal.c arch/v850/kernel/signal.c
--- ../orig/linux-2.5.52-uc0/arch/v850/kernel/signal.c 2002-11-28 10:24:54.000000000 +0900
+++ arch/v850/kernel/signal.c 2002-12-19 11:37:31.000000000 +0900
@@ -147,8 +146,6 @@

struct rt_sigframe
{
- struct siginfo *pinfo;
- void *puc;
struct siginfo info;
struct ucontext uc;
unsigned long tramp[2]; /* signal trampoline */
@@ -330,10 +327,12 @@
if (err)
goto give_sigsegv;

- /* Set up registers for signal handler */
- regs->gpr[GPR_SP] = (unsigned long) frame;
- regs->gpr[GPR_ARG0] = signal; /* Arg for signal handler */
- regs->pc = (unsigned long) ka->sa.sa_handler;
+ /* Set up registers for signal handler. */
+ regs->pc = (v850_reg_t) ka->sa.sa_handler;
+ regs->gpr[GPR_SP] = (v850_reg_t)frame;
+ /* Signal handler args: */
+ regs->gpr[GPR_ARG0] = signal; /* arg 0: signum */
+ regs->gpr[GPR_ARG1] = (v850_reg_t)&frame->sc;/* arg 1: sigcontext */

set_fs(USER_DS);

@@ -368,8 +367,6 @@
? current_thread_info()->exec_domain->signal_invmap[sig]
: sig;

- err |= __put_user(&frame->info, &frame->pinfo);
- err |= __put_user(&frame->uc, &frame->puc);
err |= copy_siginfo_to_user(&frame->info, info);

/* Create the ucontext. */
@@ -406,10 +403,13 @@
if (err)
goto give_sigsegv;

- /* Set up registers for signal handler */
- regs->gpr[GPR_SP] = (unsigned long) frame;
- regs->gpr[GPR_ARG0] = signal; /* Arg for signal handler */
- regs->pc = (unsigned long) ka->sa.sa_handler;
+ /* Set up registers for signal handler. */
+ regs->pc = (v850_reg_t) ka->sa.sa_handler;
+ regs->gpr[GPR_SP] = (v850_reg_t)frame;
+ /* Signal handler args: */
+ regs->gpr[GPR_ARG0] = signal; /* arg 0: signum */
+ regs->gpr[GPR_ARG1] = (v850_reg_t)&frame->info; /* arg 1: siginfo */
+ regs->gpr[GPR_ARG2] = (v850_reg_t)&frame->uc; /* arg 2: ucontext */

set_fs(USER_DS);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/