aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel/signal.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-03-05 09:36:49 -0500
committerRichard Weinberger <richard@sigma-star.at>2014-08-06 07:04:31 -0400
commita8040ff82ee623bfd070b920fb4b5d133f9d9953 (patch)
tree6a9fd916491eb903b84bfade366602fa081263f4 /arch/mn10300/kernel/signal.c
parent7c4f563507c33ca97dcfbd62dba1e9232575d499 (diff)
mn10300: Use sigsp()
Use sigsp() instead of the open coded variant. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/mn10300/kernel/signal.c')
-rw-r--r--arch/mn10300/kernel/signal.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/mn10300/kernel/signal.c b/arch/mn10300/kernel/signal.c
index 0c97202764ce..a6c0858592c3 100644
--- a/arch/mn10300/kernel/signal.c
+++ b/arch/mn10300/kernel/signal.c
@@ -186,20 +186,11 @@ static int setup_sigcontext(struct sigcontext __user *sc,
186/* 186/*
187 * determine which stack to use.. 187 * determine which stack to use..
188 */ 188 */
189static inline void __user *get_sigframe(struct k_sigaction *ka, 189static inline void __user *get_sigframe(struct ksignal *ksig,
190 struct pt_regs *regs, 190 struct pt_regs *regs,
191 size_t frame_size) 191 size_t frame_size)
192{ 192{
193 unsigned long sp; 193 unsigned long sp = sigsp(regs->sp, ksig);
194
195 /* default to using normal stack */
196 sp = regs->sp;
197
198 /* this is the X/Open sanctioned signal stack switching. */
199 if (ka->sa.sa_flags & SA_ONSTACK) {
200 if (sas_ss_flags(sp) == 0)
201 sp = current->sas_ss_sp + current->sas_ss_size;
202 }
203 194
204 return (void __user *) ((sp - frame_size) & ~7UL); 195 return (void __user *) ((sp - frame_size) & ~7UL);
205} 196}
@@ -213,7 +204,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
213 struct sigframe __user *frame; 204 struct sigframe __user *frame;
214 int rsig, sig = ksig->sig; 205 int rsig, sig = ksig->sig;
215 206
216 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); 207 frame = get_sigframe(ksig, regs, sizeof(*frame));
217 208
218 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 209 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
219 return -EFAULT; 210 return -EFAULT;
@@ -281,7 +272,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
281 struct rt_sigframe __user *frame; 272 struct rt_sigframe __user *frame;
282 int rsig, sig = ksig->sig; 273 int rsig, sig = ksig->sig;
283 274
284 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); 275 frame = get_sigframe(ksig, regs, sizeof(*frame));
285 276
286 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) 277 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
287 return -EFAULT; 278 return -EFAULT;