patch-2.1.97 linux/arch/ppc/kernel/ptrace.c

Next file: linux/arch/ppc/kernel/residual.c
Previous file: linux/arch/ppc/kernel/prom.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.96/linux/arch/ppc/kernel/ptrace.c linux/arch/ppc/kernel/ptrace.c
@@ -390,8 +390,14 @@
 				tmp = get_reg(child, addr);
 			}
 			else if (addr >= PT_FPR0 && addr <= PT_FPSCR) {
+#ifdef __SMP__
+				if (child->tss.regs->msr & MSR_FP )
+					smp_giveup_fpu(child);
+#else			  
+			  /* only current can be last task to use math on SMP */
 				if (last_task_used_math == child)
 					giveup_fpu();
+#endif				
 				tmp = ((long *)child->tss.fpr)[addr - PT_FPR0];
 			}
 			else
@@ -423,8 +429,13 @@
 				goto out;
 			}
 			if (addr >= PT_FPR0 && addr < PT_FPR0 + 64) {
+#ifndef __SMP__
+				if (child->tss.regs->msr & MSR_FP )
+					smp_giveup_fpu(child);
+#else	
 				if (last_task_used_math == child)
 					giveup_fpu();
+#endif				
 				((long *)child->tss.fpr)[addr - PT_FPR0] = data;
 				ret = 0;
 				goto out;

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