diff options
author | Kevin Hao <haokexin@gmail.com> | 2013-07-14 10:40:06 +0200 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-14 06:59:06 +0200 |
commit | 6761ee3d7e139ec8728e1515bfc5fdcaf3be317e (patch) | |
tree | 8e2e5ced53d6e089a1845597a248e82fb5bb3ec6 /arch/powerpc/math-emu | |
parent | powerpc/85xx: Enable the math emulation for the corenet64_smp_defconfig (diff) | |
download | linux-6761ee3d7e139ec8728e1515bfc5fdcaf3be317e.tar.xz linux-6761ee3d7e139ec8728e1515bfc5fdcaf3be317e.zip |
powerpc/math-emu: Move the flush FPU state function into do_mathemu
By doing this we can make sure that the FPU state is only flushed to
the thread struct when it is really needed.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/math-emu')
-rw-r--r-- | arch/powerpc/math-emu/math.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/math-emu/math.c b/arch/powerpc/math-emu/math.c index 3fe8e35287a1..f9ef34746f16 100644 --- a/arch/powerpc/math-emu/math.c +++ b/arch/powerpc/math-emu/math.c @@ -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) { |