diff -Nru linux/arch/mips/kernel/traps.c.orig linux/arch/mips/kernel/traps.c --- linux/arch/mips/kernel/traps.c.orig Wed Jan 30 15:17:12 2002 +++ linux/arch/mips/kernel/traps.c Thu Feb 21 18:46:28 2002 @@ -678,14 +678,11 @@ return; fp_emul: - if (last_task_used_math != current) { - if (!current->used_math) { - fpu_emulator_init_fpu(); - current->used_math = 1; - } + if (!current->used_math) { + fpu_emulator_init_fpu(); + current->used_math = 1; } sig = fpu_emulator_cop1Handler(regs); - last_task_used_math = current; if (sig) force_sig(sig, current); return; diff -Nru linux/arch/mips/math-emu/ieee754.h.orig linux/arch/mips/math-emu/ieee754.h --- linux/arch/mips/math-emu/ieee754.h.orig Thu Jan 31 17:13:26 2002 +++ linux/arch/mips/math-emu/ieee754.h Thu Feb 21 19:34:06 2002 @@ -323,7 +323,7 @@ /* the control status register */ -struct ieee754_csr { +struct ieee754_csr_struct { unsigned pad:13; unsigned nod:1; /* set 1 for no denormalised numbers */ unsigned cx:5; /* exceptions this operation */ @@ -331,7 +331,13 @@ unsigned sx:5; /* exceptions total */ unsigned rm:2; /* current rounding mode */ }; -extern struct ieee754_csr ieee754_csr; + +#include +#include +#include +#include +extern struct ieee754_csr_struct ieee754_csr_array[NR_CPUS]; +#define ieee754_csr ieee754_csr_array[smp_processor_id()] static __inline unsigned ieee754_getrm(void) { diff -Nru linux/arch/mips/math-emu/ieee754.c.orig linux/arch/mips/math-emu/ieee754.c --- linux/arch/mips/math-emu/ieee754.c.orig Mon Jan 28 11:17:14 2002 +++ linux/arch/mips/math-emu/ieee754.c Thu Feb 21 19:37:32 2002 @@ -52,7 +52,7 @@ /* the control status register */ -struct ieee754_csr ieee754_csr; +struct ieee754_csr_struct ieee754_csr_array[NR_CPUS]; /* special constants */ diff -Nru linux/arch/mips/math-emu/cp1emu.c.orig linux/arch/mips/math-emu/cp1emu.c --- linux/arch/mips/math-emu/cp1emu.c.orig Mon Jan 28 11:17:14 2002 +++ linux/arch/mips/math-emu/cp1emu.c Thu Feb 21 19:22:45 2002 @@ -945,7 +945,7 @@ static ieee754##p fpemu_##p##_##name (ieee754##p r, ieee754##p s, \ ieee754##p t) \ { \ - struct ieee754_csr ieee754_csr_save; \ + struct ieee754_csr_struct ieee754_csr_save; \ s = f1 (s, t); \ ieee754_csr_save = ieee754_csr; \ s = f2 (s, r); \ diff -Nru linux/arch/mips/math-emu/dp_sqrt.c.orig linux/arch/mips/math-emu/dp_sqrt.c --- linux/arch/mips/math-emu/dp_sqrt.c.orig Thu Feb 21 19:41:09 2002 +++ linux/arch/mips/math-emu/dp_sqrt.c Thu Feb 21 19:39:08 2002 @@ -37,7 +37,7 @@ ieee754dp ieee754dp_sqrt(ieee754dp x) { - struct ieee754_csr oldcsr; + struct ieee754_csr_struct oldcsr; ieee754dp y, z, t; unsigned scalx, yh; COMPXDP;