From e04582b7bc70b40c57287cdc24f81964ee88f565 Mon Sep 17 00:00:00 2001 From: Atsushi Nemoto Date: Mon, 9 Oct 2006 00:10:01 +0900 Subject: [MIPS] Make sure cpu_has_fpu is used only in atomic context Make sure cpu_has_fpu (which uses smp_processor_id()) is used only in atomic context. Signed-off-by: Atsushi Nemoto Signed-off-by: Ralf Baechle --- include/asm-mips/fpu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/asm-mips') diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h index 58c561a9ec6..efef843b93f 100644 --- a/include/asm-mips/fpu.h +++ b/include/asm-mips/fpu.h @@ -134,9 +134,11 @@ 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) { + preempt_disable(); + if (is_fpu_owner()) _save_fp(current); + preempt_enable(); } return tsk->thread.fpu.fpr; -- cgit v1.2.3