Commit 7c4f5635 authored by Richard Weinberger's avatar Richard Weinberger Committed by Richard Weinberger

mips: Use sigsp()

Use sigsp() instead of the open coded variant.
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent c001cd21
...@@ -280,7 +280,7 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) ...@@ -280,7 +280,7 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
return err; return err;
} }
void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs,
size_t frame_size) size_t frame_size)
{ {
unsigned long sp; unsigned long sp;
...@@ -295,9 +295,7 @@ void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, ...@@ -295,9 +295,7 @@ void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
*/ */
sp -= 32; sp -= 32;
/* This is the X/Open sanctioned signal stack switching. */ sp = sigsp(sp, ksig);
if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags (sp) == 0))
sp = current->sas_ss_sp + current->sas_ss_size;
return (void __user *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? ~(cpu_icache_line_size()-1) : ALMASK)); return (void __user *)((sp - frame_size) & (ICACHE_REFILLS_WORKAROUND_WAR ? ~(cpu_icache_line_size()-1) : ALMASK));
} }
...@@ -434,7 +432,7 @@ static int setup_frame(void *sig_return, struct ksignal *ksig, ...@@ -434,7 +432,7 @@ static int setup_frame(void *sig_return, struct ksignal *ksig,
struct sigframe __user *frame; struct sigframe __user *frame;
int err = 0; 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))) if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
return -EFAULT; return -EFAULT;
...@@ -473,7 +471,7 @@ static int setup_rt_frame(void *sig_return, struct ksignal *ksig, ...@@ -473,7 +471,7 @@ static int setup_rt_frame(void *sig_return, struct ksignal *ksig,
struct rt_sigframe __user *frame; struct rt_sigframe __user *frame;
int err = 0; 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))) if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
return -EFAULT; return -EFAULT;
......
...@@ -496,7 +496,7 @@ static int setup_frame_32(void *sig_return, struct ksignal *ksig, ...@@ -496,7 +496,7 @@ static int setup_frame_32(void *sig_return, struct ksignal *ksig,
struct sigframe32 __user *frame; struct sigframe32 __user *frame;
int err = 0; 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))) if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
return -EFAULT; return -EFAULT;
...@@ -536,7 +536,7 @@ static int setup_rt_frame_32(void *sig_return, struct ksignal *ksig, ...@@ -536,7 +536,7 @@ static int setup_rt_frame_32(void *sig_return, struct ksignal *ksig,
struct rt_sigframe32 __user *frame; struct rt_sigframe32 __user *frame;
int err = 0; 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))) if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
return -EFAULT; return -EFAULT;
......
...@@ -108,7 +108,7 @@ static int setup_rt_frame_n32(void *sig_return, struct ksignal *ksig, ...@@ -108,7 +108,7 @@ static int setup_rt_frame_n32(void *sig_return, struct ksignal *ksig,
struct rt_sigframe_n32 __user *frame; struct rt_sigframe_n32 __user *frame;
int err = 0; 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))) 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