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 ...@@ -146,8 +146,6 @@ struct sigframe
struct rt_sigframe struct rt_sigframe
{ {
struct siginfo *pinfo;
void *puc;
struct siginfo info; struct siginfo info;
struct ucontext uc; struct ucontext uc;
unsigned long tramp[2]; /* signal trampoline */ unsigned long tramp[2]; /* signal trampoline */
...@@ -329,10 +327,12 @@ static void setup_frame(int sig, struct k_sigaction *ka, ...@@ -329,10 +327,12 @@ static void setup_frame(int sig, struct k_sigaction *ka,
if (err) if (err)
goto give_sigsegv; goto give_sigsegv;
/* Set up registers for signal handler */ /* Set up registers for signal handler. */
regs->gpr[GPR_SP] = (unsigned long) frame; regs->pc = (v850_reg_t) ka->sa.sa_handler;
regs->gpr[GPR_ARG0] = signal; /* Arg for signal handler */ regs->gpr[GPR_SP] = (v850_reg_t)frame;
regs->pc = (unsigned long) ka->sa.sa_handler; /* 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); set_fs(USER_DS);
...@@ -367,8 +367,6 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -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] ? current_thread_info()->exec_domain->signal_invmap[sig]
: sig; : sig;
err |= __put_user(&frame->info, &frame->pinfo);
err |= __put_user(&frame->uc, &frame->puc);
err |= copy_siginfo_to_user(&frame->info, info); err |= copy_siginfo_to_user(&frame->info, info);
/* Create the ucontext. */ /* Create the ucontext. */
...@@ -405,10 +403,13 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -405,10 +403,13 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
if (err) if (err)
goto give_sigsegv; goto give_sigsegv;
/* Set up registers for signal handler */ /* Set up registers for signal handler. */
regs->gpr[GPR_SP] = (unsigned long) frame; regs->pc = (v850_reg_t) ka->sa.sa_handler;
regs->gpr[GPR_ARG0] = signal; /* Arg for signal handler */ regs->gpr[GPR_SP] = (v850_reg_t)frame;
regs->pc = (unsigned long) ka->sa.sa_handler; /* 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); 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