diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2005-05-09 13:16:07 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 19:31:13 +0100 |
commit | 1d74f6bc85cbdc4601e5aea1e67ccbd259f0c7f4 (patch) | |
tree | e9ffdef4000ab6e45a5d4c9233da0a7a67daf285 /include/asm-mips/fpu.h | |
parent | d547c5cc2186be9d74b0c595dc8059aef56cd445 (diff) | |
download | talos-op-linux-1d74f6bc85cbdc4601e5aea1e67ccbd259f0c7f4.tar.gz talos-op-linux-1d74f6bc85cbdc4601e5aea1e67ccbd259f0c7f4.zip |
__compute_return_epc() uses CFC1 instruction which might result in a
coprocessor unusable exception since the process can lose its fpu
context by preemption.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/fpu.h')
-rw-r--r-- | include/asm-mips/fpu.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h index ea24e733b1bc..9c828b1f8218 100644 --- a/include/asm-mips/fpu.h +++ b/include/asm-mips/fpu.h @@ -80,9 +80,14 @@ do { \ #define clear_fpu_owner() clear_thread_flag(TIF_USEDFPU) +static inline int __is_fpu_owner(void) +{ + return test_thread_flag(TIF_USEDFPU); +} + static inline int is_fpu_owner(void) { - return cpu_has_fpu && test_thread_flag(TIF_USEDFPU); + return cpu_has_fpu && __is_fpu_owner(); } static inline void own_fpu(void) @@ -127,7 +132,7 @@ static inline void restore_fp(struct task_struct *tsk) static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) { if (cpu_has_fpu) { - if ((tsk == current) && is_fpu_owner()) + if ((tsk == current) && __is_fpu_owner()) _save_fp(current); return tsk->thread.fpu.hard.fpr; } |