Commit 8215ade8 authored by Richard Weinberger's avatar Richard Weinberger Committed by Richard Weinberger

cris: Use sigsp()

Use sigsp() instead of the open coded variant.
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 615869e4
...@@ -203,15 +203,9 @@ static int setup_sigcontext(struct sigcontext __user *sc, ...@@ -203,15 +203,9 @@ static int setup_sigcontext(struct sigcontext __user *sc,
* - usually on the stack. */ * - usually on the stack. */
static inline void __user * static inline void __user *
get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) get_sigframe(struct ksignal *ksig, size_t frame_size)
{ {
unsigned long sp = rdusp(); unsigned long sp = sigsp(rdusp(), ksig);
/* This is the X/Open sanctioned signal stack switching. */
if (ka->sa.sa_flags & SA_ONSTACK) {
if (! on_sig_stack(sp))
sp = current->sas_ss_sp + current->sas_ss_size;
}
/* make sure the frame is dword-aligned */ /* make sure the frame is dword-aligned */
...@@ -235,7 +229,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, ...@@ -235,7 +229,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
unsigned long return_ip; unsigned long return_ip;
int err = 0; int err = 0;
frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); frame = get_sigframe(ksig, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT; return -EFAULT;
...@@ -287,7 +281,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, ...@@ -287,7 +281,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
unsigned long return_ip; unsigned long return_ip;
int err = 0; int err = 0;
frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); frame = get_sigframe(ksig, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT; return -EFAULT;
......
...@@ -189,17 +189,9 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, ...@@ -189,17 +189,9 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
/* Figure out where to put the new signal frame - usually on the stack. */ /* Figure out where to put the new signal frame - usually on the stack. */
static inline void __user * static inline void __user *
get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) get_sigframe(struct ksignal *ksig, size_t frame_size)
{ {
unsigned long sp; unsigned long sp = sigsp(rdusp(), ksig);
sp = rdusp();
/* This is the X/Open sanctioned signal stack switching. */
if (ka->sa.sa_flags & SA_ONSTACK) {
if (!on_sig_stack(sp))
sp = current->sas_ss_sp + current->sas_ss_size;
}
/* Make sure the frame is dword-aligned. */ /* Make sure the frame is dword-aligned. */
sp &= ~3; sp &= ~3;
...@@ -222,7 +214,7 @@ setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) ...@@ -222,7 +214,7 @@ setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
struct signal_frame __user *frame; struct signal_frame __user *frame;
err = 0; err = 0;
frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); frame = get_sigframe(ksig, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT; return -EFAULT;
...@@ -290,7 +282,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) ...@@ -290,7 +282,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
struct rt_signal_frame __user *frame; struct rt_signal_frame __user *frame;
err = 0; err = 0;
frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); frame = get_sigframe(ksig, 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