aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/traps.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2006-10-08 11:10:01 -0400
committerRalf Baechle <ralf@linux-mips.org>2006-10-09 18:20:48 -0400
commite04582b7bc70b40c57287cdc24f81964ee88f565 (patch)
treea5127c2d4165e656a84612836f6326427843acca /arch/mips/kernel/traps.c
parentf5c70dd7f384db4c524c35288d9be3ed61ac41a9 (diff)
[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 'arch/mips/kernel/traps.c')
-rw-r--r--arch/mips/kernel/traps.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index b7292a56d4cd..cce8313ec27d 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -66,7 +66,7 @@ extern asmlinkage void handle_mcheck(void);
66extern asmlinkage void handle_reserved(void); 66extern asmlinkage void handle_reserved(void);
67 67
68extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, 68extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
69 struct mips_fpu_struct *ctx); 69 struct mips_fpu_struct *ctx, int has_fpu);
70 70
71void (*board_be_init)(void); 71void (*board_be_init)(void);
72int (*board_be_handler)(struct pt_regs *regs, int is_fixup); 72int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
@@ -641,7 +641,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31)
641 preempt_enable(); 641 preempt_enable();
642 642
643 /* Run the emulator */ 643 /* Run the emulator */
644 sig = fpu_emulator_cop1Handler (regs, &current->thread.fpu); 644 sig = fpu_emulator_cop1Handler (regs, &current->thread.fpu, 1);
645 645
646 preempt_disable(); 646 preempt_disable();
647 647
@@ -791,11 +791,13 @@ asmlinkage void do_cpu(struct pt_regs *regs)
791 set_used_math(); 791 set_used_math();
792 } 792 }
793 793
794 preempt_enable(); 794 if (cpu_has_fpu) {
795 795 preempt_enable();
796 if (!cpu_has_fpu) { 796 } else {
797 int sig = fpu_emulator_cop1Handler(regs, 797 int sig;
798 &current->thread.fpu); 798 preempt_enable();
799 sig = fpu_emulator_cop1Handler(regs,
800 &current->thread.fpu, 0);
799 if (sig) 801 if (sig)
800 force_sig(sig, current); 802 force_sig(sig, current);
801#ifdef CONFIG_MIPS_MT_FPAFF 803#ifdef CONFIG_MIPS_MT_FPAFF