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

Next file: linux/drivers/block/genhd.c
Previous file: linux/arch/i386/kernel/io_apic.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.122/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
@@ -540,10 +540,10 @@
 static inline void unlazy_fpu(struct task_struct *tsk)
 {
 	if (tsk->flags & PF_USEDFPU) {
-		tsk->flags &= ~PF_USEDFPU;
 		__asm__("fnsave %0":"=m" (tsk->tss.i387));
-		stts();
 		asm volatile("fwait");
+		tsk->flags &= ~PF_USEDFPU;
+		stts();
 	}
 }
 
@@ -737,8 +737,11 @@
 		asm volatile("lldt %0": :"g" (*(unsigned short *)&next->tss.ldt));
 
 	/* Re-load page tables */
-	if (next->tss.cr3 != prev->tss.cr3)
-		asm volatile("movl %0,%%cr3": :"r" (next->tss.cr3));
+	{
+		unsigned long new_cr3 = next->tss.cr3;
+		if (new_cr3 != prev->tss.cr3) 
+			asm volatile("movl %0,%%cr3": :"r" (new_cr3));
+	}
 
 	/*
 	 * Restore %fs and %gs.

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