aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/signal_n32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/signal_n32.c')
-rw-r--r--arch/mips/kernel/signal_n32.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index b2241bb9cac1..f1d4751eead0 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -102,18 +102,18 @@ badframe:
102 force_sig(SIGSEGV, current); 102 force_sig(SIGSEGV, current);
103} 103}
104 104
105static int setup_rt_frame_n32(void *sig_return, struct k_sigaction *ka, 105static int setup_rt_frame_n32(void *sig_return, struct ksignal *ksig,
106 struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info) 106 struct pt_regs *regs, sigset_t *set)
107{ 107{
108 struct rt_sigframe_n32 __user *frame; 108 struct rt_sigframe_n32 __user *frame;
109 int err = 0; 109 int err = 0;
110 110
111 frame = get_sigframe(ka, regs, sizeof(*frame)); 111 frame = get_sigframe(ksig, regs, sizeof(*frame));
112 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) 112 if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
113 goto give_sigsegv; 113 return -EFAULT;
114 114
115 /* Create siginfo. */ 115 /* Create siginfo. */
116 err |= copy_siginfo_to_user32(&frame->rs_info, info); 116 err |= copy_siginfo_to_user32(&frame->rs_info, &ksig->info);
117 117
118 /* Create the ucontext. */ 118 /* Create the ucontext. */
119 err |= __put_user(0, &frame->rs_uc.uc_flags); 119 err |= __put_user(0, &frame->rs_uc.uc_flags);
@@ -123,7 +123,7 @@ static int setup_rt_frame_n32(void *sig_return, struct k_sigaction *ka,
123 err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set); 123 err |= __copy_conv_sigset_to_user(&frame->rs_uc.uc_sigmask, set);
124 124
125 if (err) 125 if (err)
126 goto give_sigsegv; 126 return -EFAULT;
127 127
128 /* 128 /*
129 * Arguments to signal handler: 129 * Arguments to signal handler:
@@ -135,22 +135,18 @@ static int setup_rt_frame_n32(void *sig_return, struct k_sigaction *ka,
135 * $25 and c0_epc point to the signal handler, $29 points to 135 * $25 and c0_epc point to the signal handler, $29 points to
136 * the struct rt_sigframe. 136 * the struct rt_sigframe.
137 */ 137 */
138 regs->regs[ 4] = signr; 138 regs->regs[ 4] = ksig->sig;
139 regs->regs[ 5] = (unsigned long) &frame->rs_info; 139 regs->regs[ 5] = (unsigned long) &frame->rs_info;
140 regs->regs[ 6] = (unsigned long) &frame->rs_uc; 140 regs->regs[ 6] = (unsigned long) &frame->rs_uc;
141 regs->regs[29] = (unsigned long) frame; 141 regs->regs[29] = (unsigned long) frame;
142 regs->regs[31] = (unsigned long) sig_return; 142 regs->regs[31] = (unsigned long) sig_return;
143 regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; 143 regs->cp0_epc = regs->regs[25] = (unsigned long) ksig->ka.sa.sa_handler;
144 144
145 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n", 145 DEBUGP("SIG deliver (%s:%d): sp=0x%p pc=0x%lx ra=0x%lx\n",
146 current->comm, current->pid, 146 current->comm, current->pid,
147 frame, regs->cp0_epc, regs->regs[31]); 147 frame, regs->cp0_epc, regs->regs[31]);
148 148
149 return 0; 149 return 0;
150
151give_sigsegv:
152 force_sigsegv(signr, current);
153 return -EFAULT;
154} 150}
155 151
156struct mips_abi mips_abi_n32 = { 152struct mips_abi mips_abi_n32 = {