Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173497
b: refs/heads/master
c: 0f09e19
h: refs/heads/master
i:
  173495: c7da94d
v: v3
  • Loading branch information
Paul Mundt committed Nov 24, 2009
1 parent 1e13f1b commit 3daffaf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3ea9fa0a563620fe9f416f94bb8927c64390917
refs/heads/master: 0f09e197a39c081fa8c2752ee65919cb6cba963a
16 changes: 12 additions & 4 deletions trunk/arch/sh/kernel/cpu/sh2a/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,18 +608,18 @@ BUILD_TRAP_HANDLER(fpu_error)
force_sig(SIGFPE, tsk);
}

BUILD_TRAP_HANDLER(fpu_state_restore)
void fpu_state_restore(struct pt_regs *regs)
{
struct task_struct *tsk = current;
TRAP_HANDLER_DECL;

grab_fpu(regs);
if (!user_mode(regs)) {
if (unlikely(!user_mode(regs))) {
printk(KERN_ERR "BUG: FPU is used in kernel mode.\n");
BUG();
return;
}

if (used_math()) {
if (likely(used_math())) {
/* Using the FPU again. */
restore_fpu(tsk);
} else {
Expand All @@ -628,4 +628,12 @@ BUILD_TRAP_HANDLER(fpu_state_restore)
set_used_math();
}
task_thread_info(tsk)->status |= TS_USEDFPU;
tsk->fpu_counter++;
}

BUILD_TRAP_HANDLER(fpu_state_restore)
{
TRAP_HANDLER_DECL;

fpu_state_restore(regs);
}

0 comments on commit 3daffaf

Please sign in to comment.