[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1405951409-16953-34-git-send-email-richard@sigma-star.at>
Date: Mon, 21 Jul 2014 16:03:19 +0200
From: Richard Weinberger <richard@...ma-star.at>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
Richard Weinberger <richard@....at>, starvik@...s.com,
jesper.nilsson@...s.com, linux-cris-kernel@...s.com
Subject: [PATCH 33/43] cris: Use sigsp()
From: Richard Weinberger <richard@....at>
Use sigsp() instead of the open coded variant.
Signed-off-by: Richard Weinberger <richard@....at>
---
arch/cris/arch-v10/kernel/signal.c | 14 ++++----------
arch/cris/arch-v32/kernel/signal.c | 16 ++++------------
2 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 12aac1f..9b32d33 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -203,15 +203,9 @@ static int setup_sigcontext(struct sigcontext __user *sc,
* - usually on the stack. */
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();
-
- /* 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;
- }
+ unsigned long sp = sigsp(rdusp(), ksig);
/* make sure the frame is dword-aligned */
@@ -235,7 +229,7 @@ static int setup_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, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
@@ -287,7 +281,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, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index cc7a39a..78ce3b1 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -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. */
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;
-
- 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;
- }
+ unsigned long sp = sigsp(rdusp(), ksig);
/* Make sure the frame is dword-aligned. */
sp &= ~3;
@@ -222,7 +214,7 @@ setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
struct signal_frame __user *frame;
err = 0;
- frame = get_sigframe(&ksig->ka, regs, sizeof(*frame));
+ frame = get_sigframe(ksig, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
@@ -290,7 +282,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
struct rt_signal_frame __user *frame;
err = 0;
- frame = get_sigframe(&ksig->ka, regs, sizeof(*frame));
+ frame = get_sigframe(ksig, sizeof(*frame));
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
return -EFAULT;
--
1.8.4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists