aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-10-09 00:10:01 +0900
committerRalf Baechle <ralf@linux-mips.org>2006-10-09 23:20:48 +0100
commite04582b7bc70b40c57287cdc24f81964ee88f565 (patch)
treea5127c2d4165e656a84612836f6326427843acca /include
parentf5c70dd7f384db4c524c35288d9be3ed61ac41a9 (diff)
downloadlinux-e04582b7bc70b40c57287cdc24f81964ee88f565.tar.gz
[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 <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-mips/fpu.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index 58c561a9ec6b74..efef843b93f0c1 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;