aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-03-05 09:28:59 -0500
committerRichard Weinberger <richard@sigma-star.at>2014-08-06 07:04:09 -0400
commit36992f2893d224add9a1e4b9114aa04f4640853b (patch)
treead42142fe6f727a5468183fbdc4cb216b425e732 /arch/m68k
parent5c0806faf1a3837db38542c3bae085f23beac7f1 (diff)
m68k: Use sigsp()
Use sigsp() instead of the open coded variant. Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/signal.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index c8e6fa865996..967a8b7e1527 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -835,18 +835,10 @@ static inline int rt_setup_ucontext(struct ucontext __user *uc, struct pt_regs *
835} 835}
836 836
837static inline void __user * 837static inline void __user *
838get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) 838get_sigframe(struct ksignal *ksig, size_t frame_size)
839{ 839{
840 unsigned long usp; 840 unsigned long usp = sigsp(rdusp(), ksig);
841
842 /* Default to using normal stack. */
843 usp = rdusp();
844 841
845 /* This is the X/Open sanctioned signal stack switching. */
846 if (ka->sa.sa_flags & SA_ONSTACK) {
847 if (!sas_ss_flags(usp))
848 usp = current->sas_ss_sp + current->sas_ss_size;
849 }
850 return (void __user *)((usp - frame_size) & -8UL); 842 return (void __user *)((usp - frame_size) & -8UL);
851} 843}
852 844
@@ -866,7 +858,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
866 return -EFAULT; 858 return -EFAULT;
867 } 859 }
868 860
869 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame) + fsize); 861 frame = get_sigframe(ksig, sizeof(*frame) + fsize);
870 862
871 if (fsize) 863 if (fsize)
872 err |= copy_to_user (frame + 1, regs + 1, fsize); 864 err |= copy_to_user (frame + 1, regs + 1, fsize);
@@ -951,7 +943,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
951 return -EFAULT; 943 return -EFAULT;
952 } 944 }
953 945
954 frame = get_sigframe(&ksig->ka, regs, sizeof(*frame)); 946 frame = get_sigframe(ksig, sizeof(*frame));
955 947
956 if (fsize) 948 if (fsize)
957 err |= copy_to_user (&frame->uc.uc_extra, regs + 1, fsize); 949 err |= copy_to_user (&frame->uc.uc_extra, regs + 1, fsize);