patch-2.4.22 linux-2.4.22/include/asm-x86_64/i387.h

Next file: linux-2.4.22/include/asm-x86_64/io_apic.h
Previous file: linux-2.4.22/include/asm-x86_64/desc.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/include/asm-x86_64/i387.h linux-2.4.22/include/asm-x86_64/i387.h
@@ -16,6 +16,7 @@
 #include <asm/processor.h>
 #include <asm/sigcontext.h>
 #include <asm/user.h>
+#include <asm/uaccess.h>
 
 extern void init_fpu(struct task_struct *child);
 extern int save_i387(struct _fpstate *buf);
@@ -85,6 +86,8 @@
 		     ".previous"
 		     : [err] "=r" (err)
 		     : [fx] "r" (fx), "0" (0)); 
+	if (unlikely(err))
+		init_fpu(current);
 	return err;
 } 
 
@@ -103,6 +106,8 @@
 		     ".previous"
 		     : [err] "=r" (err)
 		     : [fx] "r" (fx), "0" (0)); 
+	if (unlikely(err))
+		__clear_user(fx, sizeof(struct i387_fxsave_struct));
 	return err;
 } 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)