From d970e42897525adc836207b44ef64347e59d613e Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun, 23 Dec 2012 02:07:30 -0500
Subject: cris: switch to generic sigaltstack

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/cris/arch-v10/kernel/signal.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

(limited to 'arch/cris/arch-v10/kernel')

diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 0bb477c13a4e..187237f655e6 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -84,12 +84,6 @@ int sys_sigaction(int sig, const struct old_sigaction __user *act,
 	return ret;
 }
 
-int sys_sigaltstack(const stack_t *uss, stack_t __user *uoss)
-{
-	return do_sigaltstack(uss, uoss, rdusp());
-}
-
-
 /*
  * Do a signal return; undo the signal stack.
  */
@@ -214,7 +208,7 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
 	if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
 		goto badframe;
 
-	if (do_sigaltstack(&frame->uc.uc_stack, NULL, rdusp()) == -EFAULT)
+	if (restore_altstack(&frame->uc.uc_stack))
 		goto badframe;
 
 	return regs->r10;
-- 
cgit v1.2.2


From 9df794d9275d41012909aaff3cab759e37871974 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun, 23 Dec 2012 02:11:49 -0500
Subject: cris: don't leave ->uc_stack unitialized - we'll use its contents on
 sigreturn

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/cris/arch-v10/kernel/signal.c | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'arch/cris/arch-v10/kernel')

diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 187237f655e6..9570946a6958 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -356,6 +356,8 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 
 	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
 
+	err |= __save_altstack(&frame->uc.uc_stack, rdusp());
+
 	if (err)
 		goto give_sigsegv;
 
-- 
cgit v1.2.2


From 86df89a0845a80aa765f3e5e0da43fdf9287029f Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Tue, 25 Dec 2012 16:28:27 -0500
Subject: cris: switch to generic old sigsuspend

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/cris/arch-v10/kernel/signal.c | 12 ------------
 1 file changed, 12 deletions(-)

(limited to 'arch/cris/arch-v10/kernel')

diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 9570946a6958..e53c1b455c35 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -41,18 +41,6 @@
 
 void do_signal(int canrestart, struct pt_regs *regs);
 
-/*
- * Atomically swap in the new signal mask, and wait for a signal.  Define
- * dummy arguments to be able to reach the regs argument.  (Note that this
- * arrangement relies on old_sigset_t occupying one register.)
- */
-int sys_sigsuspend(old_sigset_t mask)
-{
-	sigset_t blocked;
-	siginitset(&blocked, mask);
-	return sigsuspend(&blocked);
-}
-
 int sys_sigaction(int sig, const struct old_sigaction __user *act,
 	struct old_sigaction *oact)
 {
-- 
cgit v1.2.2


From eb2f256682e5af4b890d1f3cce4a4d4b62ffa655 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Tue, 25 Dec 2012 19:30:53 -0500
Subject: cris: switch to generic old sigaction()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/cris/arch-v10/kernel/signal.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

(limited to 'arch/cris/arch-v10/kernel')

diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index e53c1b455c35..090e9c64408b 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -41,37 +41,6 @@
 
 void do_signal(int canrestart, struct pt_regs *regs);
 
-int sys_sigaction(int sig, const struct old_sigaction __user *act,
-	struct old_sigaction *oact)
-{
-	struct k_sigaction new_ka, old_ka;
-	int ret;
-
-	if (act) {
-		old_sigset_t mask;
-		if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
-		    __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
-		    __get_user(new_ka.sa.sa_restorer, &act->sa_restorer) ||
-		     __get_user(new_ka.sa.sa_flags, &act->sa_flags) ||
-		     __get_user(mask, &act->sa_mask))
-			return -EFAULT;
-		siginitset(&new_ka.sa.sa_mask, mask);
-	}
-
-	ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
-
-	if (!ret && oact) {
-		if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
-		    __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
-		    __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer) ||
-		    __put_user(old_ka.sa.sa_flags, &oact->sa_flags) ||
-		    __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask))
-			return -EFAULT;
-	}
-
-	return ret;
-}
-
 /*
  * Do a signal return; undo the signal stack.
  */
-- 
cgit v1.2.2


From e6a6d210e0c2ad95047e2922394fb6e73bf438ab Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Wed, 26 Dec 2012 22:11:53 -0500
Subject: cris: kill weird arguments of sys_{rt_,}sigreturn()

It's cheaper to call current_pt_regs() than bother fetching the damn
thing from stack.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/cris/arch-v10/kernel/signal.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

(limited to 'arch/cris/arch-v10/kernel')

diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 090e9c64408b..61ce6273a895 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -101,11 +101,9 @@ badframe:
 	return 1;
 }
 
-/* Define dummy arguments to be able to reach the regs argument.  */
-
-asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
-                             long srp, struct pt_regs *regs)
+asmlinkage int sys_sigreturn(void)
 {
+	struct pt_regs *regs = current_pt_regs();
 	struct sigframe __user *frame = (struct sigframe *)rdusp();
 	sigset_t set;
 
@@ -139,11 +137,9 @@ badframe:
 	return 0;
 }
 
-/* Define dummy arguments to be able to reach the regs argument.  */
-
-asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
-                                long mof, long srp, struct pt_regs *regs)
+asmlinkage int sys_rt_sigreturn(void)
 {
+	struct pt_regs *regs = current_pt_regs();
 	struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp();
 	sigset_t set;
 
-- 
cgit v1.2.2