aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-11-24 03:56:17 -0500
committerPaul Mundt <lethal@linux-sh.org>2009-11-24 03:56:17 -0500
commit0f09e197a39c081fa8c2752ee65919cb6cba963a (patch)
tree4b3e8f930f317d775b814c65898d100ba1450241 /arch
parentd3ea9fa0a563620fe9f416f94bb8927c64390917 (diff)
sh: Apply the sleazy FPU changes for SH-2A FPU as well.
This plugs in the fpu_counter manipulation for the SH-2A side also. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/kernel/cpu/sh2a/fpu.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/sh/kernel/cpu/sh2a/fpu.c b/arch/sh/kernel/cpu/sh2a/fpu.c
index 13817ee49d52..d395ce5740e7 100644
--- a/arch/sh/kernel/cpu/sh2a/fpu.c
+++ b/arch/sh/kernel/cpu/sh2a/fpu.c
@@ -608,18 +608,18 @@ BUILD_TRAP_HANDLER(fpu_error)
608 force_sig(SIGFPE, tsk); 608 force_sig(SIGFPE, tsk);
609} 609}
610 610
611BUILD_TRAP_HANDLER(fpu_state_restore) 611void fpu_state_restore(struct pt_regs *regs)
612{ 612{
613 struct task_struct *tsk = current; 613 struct task_struct *tsk = current;
614 TRAP_HANDLER_DECL;
615 614
616 grab_fpu(regs); 615 grab_fpu(regs);
617 if (!user_mode(regs)) { 616 if (unlikely(!user_mode(regs))) {
618 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n"); 617 printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
618 BUG();
619 return; 619 return;
620 } 620 }
621 621
622 if (used_math()) { 622 if (likely(used_math())) {
623 /* Using the FPU again. */ 623 /* Using the FPU again. */
624 restore_fpu(tsk); 624 restore_fpu(tsk);
625 } else { 625 } else {
@@ -628,4 +628,12 @@ BUILD_TRAP_HANDLER(fpu_state_restore)
628 set_used_math(); 628 set_used_math();
629 } 629 }
630 task_thread_info(tsk)->status |= TS_USEDFPU; 630 task_thread_info(tsk)->status |= TS_USEDFPU;
631 tsk->fpu_counter++;
632}
633
634BUILD_TRAP_HANDLER(fpu_state_restore)
635{
636 TRAP_HANDLER_DECL;
637
638 fpu_state_restore(regs);
631} 639}