Commit 0f09e197 authored by Paul Mundt's avatar Paul Mundt

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: default avatarPaul Mundt <lethal@linux-sh.org>
parent d3ea9fa0
...@@ -608,18 +608,18 @@ BUILD_TRAP_HANDLER(fpu_error) ...@@ -608,18 +608,18 @@ BUILD_TRAP_HANDLER(fpu_error)
force_sig(SIGFPE, tsk); force_sig(SIGFPE, tsk);
} }
BUILD_TRAP_HANDLER(fpu_state_restore) void fpu_state_restore(struct pt_regs *regs)
{ {
struct task_struct *tsk = current; struct task_struct *tsk = current;
TRAP_HANDLER_DECL;
grab_fpu(regs); grab_fpu(regs);
if (!user_mode(regs)) { if (unlikely(!user_mode(regs))) {
printk(KERN_ERR "BUG: FPU is used in kernel mode.\n"); printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
BUG();
return; return;
} }
if (used_math()) { if (likely(used_math())) {
/* Using the FPU again. */ /* Using the FPU again. */
restore_fpu(tsk); restore_fpu(tsk);
} else { } else {
...@@ -628,4 +628,12 @@ BUILD_TRAP_HANDLER(fpu_state_restore) ...@@ -628,4 +628,12 @@ BUILD_TRAP_HANDLER(fpu_state_restore)
set_used_math(); set_used_math();
} }
task_thread_info(tsk)->status |= TS_USEDFPU; task_thread_info(tsk)->status |= TS_USEDFPU;
tsk->fpu_counter++;
}
BUILD_TRAP_HANDLER(fpu_state_restore)
{
TRAP_HANDLER_DECL;
fpu_state_restore(regs);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment