
From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

This patch had fixed restore_sigcontext/restore_sigcontext32 about MIPS. 
This patch is only for 2.6.11-rc2-mm1.

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/mips/kernel/signal.c   |    4 +++-
 25-akpm/arch/mips/kernel/signal32.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff -puN arch/mips/kernel/signal32.c~make-used_math-smp-safe-mips-fix arch/mips/kernel/signal32.c
--- 25/arch/mips/kernel/signal32.c~make-used_math-smp-safe-mips-fix	2005-01-25 21:45:11.127104088 -0800
+++ 25-akpm/arch/mips/kernel/signal32.c	2005-01-25 21:45:11.133103176 -0800
@@ -337,6 +337,7 @@ static asmlinkage int restore_sigcontext
 					   struct sigcontext32 *sc)
 {
 	int err = 0;
+	__u32 used_math;
 
 	/* Always make any pending restarted system calls return -EINTR */
 	current_thread_info()->restart_block.fn = do_no_restart_syscall;
@@ -361,7 +362,8 @@ static asmlinkage int restore_sigcontext
 	restore_gp_reg(31);
 #undef restore_gp_reg
 
-	err |= __get_user(!!used_math(), &sc->sc_used_math);
+	err |= __get_user(used_math, &sc->sc_used_math);
+	conditional_used_math(used_math);
 
 	preempt_disable();
 
diff -puN arch/mips/kernel/signal.c~make-used_math-smp-safe-mips-fix arch/mips/kernel/signal.c
--- 25/arch/mips/kernel/signal.c~make-used_math-smp-safe-mips-fix	2005-01-25 21:45:11.129103784 -0800
+++ 25-akpm/arch/mips/kernel/signal.c	2005-01-25 21:45:11.133103176 -0800
@@ -154,6 +154,7 @@ asmlinkage int sys_sigaltstack(nabi_no_r
 asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
 {
 	int err = 0;
+	unsigned int used_math;
 
 	/* Always make any pending restarted system calls return -EINTR */
 	current_thread_info()->restart_block.fn = do_no_restart_syscall;
@@ -178,7 +179,8 @@ asmlinkage int restore_sigcontext(struct
 	restore_gp_reg(31);
 #undef restore_gp_reg
 
-	err |= __get_user(!!used_math(), &sc->sc_used_math);
+	err |= __get_user(used_math, &sc->sc_used_math);
+	conditional_used_math(used_math);
 
 	preempt_disable();
 
_
