aboutsummaryrefslogtreecommitdiffstats
path: root/arch/frv/kernel
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-03-05 08:56:52 -0500
committerRichard Weinberger <richard@sigma-star.at>2014-08-06 07:04:08 -0400
commit4a03ac362ebd115c0e42863b288648f5b536c95f (patch)
tree1a9eeba7c43e5e7ae18fc735f3db13871bbd3f3d /arch/frv/kernel
parent8215ade82d699be33a2fa545bceca29c95fcfa47 (diff)
frv: Use sigsp()
Use sigsp() instead of the open coded variant. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/frv/kernel')
-rw-r--r--arch/frv/kernel/signal.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/frv/kernel/signal.c b/arch/frv/kernel/signal.c
index 8e37cf237e6d..dc3d59de0870 100644
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@ -158,19 +158,10 @@ static int setup_sigcontext(struct sigcontext __user *sc, unsigned long mask)
158/* 158/*
159 * Determine which stack to use.. 159 * Determine which stack to use..
160 */ 160 */
161static inline void __user *get_sigframe(struct k_sigaction *ka, 161static inline void __user *get_sigframe(struct ksignal *ksig,
162 size_t frame_size) 162 size_t frame_size)
163{ 163{
164 unsigned long sp; 164 unsigned long sp = sigsp(__frame->sp, ksig);
165
166 /* Default to using normal stack */
167 sp = __frame->sp;
168
169 /* This is the X/Open sanctioned signal stack switching. */
170 if (ka->sa.sa_flags & SA_ONSTACK) {
171 if (! sas_ss_flags(sp))
172 sp = current->sas_ss_sp + current->sas_ss_size;
173 }
174 165
175 return (void __user *) ((sp - frame_size) & ~7UL); 166 return (void __user *) ((sp - frame_size) & ~7UL);
176 167
@@ -187,7 +178,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
187 178
188 set_fs(USER_DS); 179 set_fs(USER_DS);
189 180
190 frame = get_sigframe(&ksig->ka, sizeof(*frame)); 181 frame = get_sigframe(ksig, sizeof(*frame));
191 182
192 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 183 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
193 return -EFAULT; 184 return -EFAULT;
@@ -268,7 +259,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
268 259
269 set_fs(USER_DS); 260 set_fs(USER_DS);
270 261
271 frame = get_sigframe(&ksig->ka, sizeof(*frame)); 262 frame = get_sigframe(ksig, sizeof(*frame));
272 263
273 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 264 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
274 return -EFAULT; 265 return -EFAULT;