diff options
author | Richard Weinberger <richard@nod.at> | 2014-03-05 15:49:40 +0100 |
---|---|---|
committer | Richard Weinberger <richard@sigma-star.at> | 2014-08-06 13:04:31 +0200 |
commit | 8e2beafa2f7f48b1392c00897578e5daf858fe59 (patch) | |
tree | e3f650ae3cfe786476d66ca94821a533031b76b1 /arch/openrisc/kernel | |
parent | a8040ff82ee623bfd070b920fb4b5d133f9d9953 (diff) |
openrisc: Use sigsp()
Use sigsp() instead of the open coded variant.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/openrisc/kernel')
-rw-r--r-- | arch/openrisc/kernel/signal.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/arch/openrisc/kernel/signal.c b/arch/openrisc/kernel/signal.c index 66775bc07a8..7d1b8235bf9 100644 --- a/arch/openrisc/kernel/signal.c +++ b/arch/openrisc/kernel/signal.c @@ -132,30 +132,16 @@ static inline unsigned long align_sigframe(unsigned long sp) * or the alternate stack. */ -static inline void __user *get_sigframe(struct k_sigaction *ka, +static inline void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, size_t frame_size) { unsigned long sp = regs->sp; - int onsigstack = on_sig_stack(sp); /* redzone */ sp -= STACK_FRAME_OVERHEAD; - - /* This is the X/Open sanctioned signal stack switching. */ - if ((ka->sa.sa_flags & SA_ONSTACK) && !onsigstack) { - if (current->sas_ss_size) - sp = current->sas_ss_sp + current->sas_ss_size; - } - + sp = sigsp(sp, ksig); sp = align_sigframe(sp - frame_size); - /* - * If we are on the alternate signal stack and would overflow it, don't. - * Return an always-bogus address instead so we will die with SIGSEGV. - */ - if (onsigstack && !likely(on_sig_stack(sp))) - return (void __user *)-1L; - return (void __user *)sp; } @@ -173,7 +159,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, unsigned long return_ip; int err = 0; - frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); + frame = get_sigframe(ksig, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) return -EFAULT; |