Commit 6d667106 authored by Chris Dearman's avatar Chris Dearman Committed by Ralf Baechle

[MIPS] Check FCSR for pending interrupts before restoring from a context.

Signed-off-by: default avatarChris Dearman <chris@mips.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent b86b30f8
...@@ -114,6 +114,14 @@ LEAF(_save_fp_context32) ...@@ -114,6 +114,14 @@ LEAF(_save_fp_context32)
*/ */
LEAF(_restore_fp_context) LEAF(_restore_fp_context)
EX lw t0, SC_FPC_CSR(a0) EX lw t0, SC_FPC_CSR(a0)
/* Fail if the CSR has exceptions pending */
srl t1, t0, 5
and t1, t0
andi t1, 0x1f << 7
bnez t1, fault
nop
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
EX ldc1 $f1, SC_FPREGS+8(a0) EX ldc1 $f1, SC_FPREGS+8(a0)
EX ldc1 $f3, SC_FPREGS+24(a0) EX ldc1 $f3, SC_FPREGS+24(a0)
...@@ -157,6 +165,14 @@ LEAF(_restore_fp_context) ...@@ -157,6 +165,14 @@ LEAF(_restore_fp_context)
LEAF(_restore_fp_context32) LEAF(_restore_fp_context32)
/* Restore an o32 sigcontext. */ /* Restore an o32 sigcontext. */
EX lw t0, SC32_FPC_CSR(a0) EX lw t0, SC32_FPC_CSR(a0)
/* Fail if the CSR has exceptions pending */
srl t1, t0, 5
and t1, t0
andi t1, 0x1f << 7
bnez t1, fault
nop
EX ldc1 $f0, SC32_FPREGS+0(a0) EX ldc1 $f0, SC32_FPREGS+0(a0)
EX ldc1 $f2, SC32_FPREGS+16(a0) EX ldc1 $f2, SC32_FPREGS+16(a0)
EX ldc1 $f4, SC32_FPREGS+32(a0) EX ldc1 $f4, SC32_FPREGS+32(a0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment