Commit fb2fde15 authored by Miles Bader's avatar Miles Bader Committed by Linus Torvalds

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

The old code seems completely wrong; I guess it was just left over from
whichever architecture this code was copied from.
parent 0c907d80
......@@ -146,8 +146,6 @@ struct sigframe
struct rt_sigframe
{
struct siginfo *pinfo;
void *puc;
struct siginfo info;
struct ucontext uc;
unsigned long tramp[2]; /* signal trampoline */
......@@ -329,10 +327,12 @@ static void setup_frame(int sig, struct k_sigaction *ka,
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);
......@@ -367,8 +367,6 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
? 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. */
......@@ -405,10 +403,13 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment