powerpc/math-emu: Move the flush FPU state function into do_mathemu
[profile/ivi/kernel-x86-ivi.git] / arch / powerpc / math-emu / math.c
index 3fe8e35..f9ef347 100644 (file)
@@ -420,6 +420,15 @@ do_mathemu(struct pt_regs *regs)
                goto illegal;
        }
 
+       /*
+        * If we support a HW FPU, we need to ensure the FP state
+        * is flushed into the thread_struct before attempting
+        * emulation
+        */
+#ifdef CONFIG_PPC_FPU
+       flush_fp_to_thread(current);
+#endif
+
        eflag = func(op0, op1, op2, op3);
 
        if (insn & 1) {