patch-2.1.73 linux/arch/i386/kernel/process.c

Next file: linux/arch/i386/kernel/ptrace.c
Previous file: linux/arch/i386/defconfig
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.72/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
@@ -40,6 +40,10 @@
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/ldt.h>
+#include <asm/processor.h>
+#ifdef CONFIG_MATH_EMULATION
+#include <asm/math_emu.h>
+#endif
 
 #ifdef __SMP__
 asmlinkage void ret_from_smpfork(void) __asm__("ret_from_smpfork");
@@ -525,19 +529,16 @@
 {
 	int fpvalid;
 
-/* Flag indicating the math stuff is valid. We don't support this for the
-   soft-float routines yet */
-	if (hard_math) {
-		if ((fpvalid = current->used_math) != 0) {
-			if (last_task_used_math == current)
-				__asm__("clts ; fnsave %0": :"m" (*fpu));
+	if ((fpvalid = current->used_math) != 0) {
+		if (hard_math) {
+		  if (last_task_used_math == current) {
+			  __asm__("clts ; fsave %0; fwait": :"m" (*fpu));
+		  }
 			else
 				memcpy(fpu,&current->tss.i387.hard,sizeof(*fpu));
+		} else {
+			memcpy(fpu,&current->tss.i387.hard,sizeof(*fpu));
 		}
-	} else {
-		/* we should dump the emulator state here, but we need to
-		   convert it into standard 387 format first.. */
-		fpvalid = 0;
 	}
 
 	return fpvalid;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov