Commit a8040ff8 authored by Richard Weinberger's avatar Richard Weinberger Committed by Richard Weinberger

mn10300: Use sigsp()

Use sigsp() instead of the open coded variant.
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 7c4f5635
...@@ -186,20 +186,11 @@ static int setup_sigcontext(struct sigcontext __user *sc, ...@@ -186,20 +186,11 @@ static int setup_sigcontext(struct sigcontext __user *sc,
/* /*
* determine which stack to use.. * determine which stack to use..
*/ */
static inline void __user *get_sigframe(struct k_sigaction *ka, static inline void __user *get_sigframe(struct ksignal *ksig,
struct pt_regs *regs, struct pt_regs *regs,
size_t frame_size) size_t frame_size)
{ {
unsigned long sp; unsigned long sp = sigsp(regs->sp, ksig);
/* default to using normal stack */
sp = regs->sp;
/* this is the X/Open sanctioned signal stack switching. */
if (ka->sa.sa_flags & SA_ONSTACK) {
if (sas_ss_flags(sp) == 0)
sp = current->sas_ss_sp + current->sas_ss_size;
}
return (void __user *) ((sp - frame_size) & ~7UL); return (void __user *) ((sp - frame_size) & ~7UL);
} }
...@@ -213,7 +204,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, ...@@ -213,7 +204,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
struct sigframe __user *frame; struct sigframe __user *frame;
int rsig, sig = ksig->sig; int rsig, sig = ksig->sig;
frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); frame = get_sigframe(ksig, regs, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT; return -EFAULT;
...@@ -281,7 +272,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, ...@@ -281,7 +272,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
struct rt_sigframe __user *frame; struct rt_sigframe __user *frame;
int rsig, sig = ksig->sig; int rsig, sig = ksig->sig;
frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); frame = get_sigframe(ksig, regs, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT; return -EFAULT;
......
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