summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/i387.h
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-04-08 13:31:58 +0200
committerIngo Molnar <mingo@elte.hu>2009-04-08 13:46:00 +0200
commitfcb2ac5bdfa3a7a04fb9749b916f64400f4c35a8 (patch)
treec251c870e6f01dafea5e370898e74968b3cda8c4 /arch/x86/include/asm/i387.h
parent577c9c456f0e1371cbade38eaf91ae8e8a308555 (diff)
downloadblackbird-op-linux-fcb2ac5bdfa3a7a04fb9749b916f64400f4c35a8.tar.gz
blackbird-op-linux-fcb2ac5bdfa3a7a04fb9749b916f64400f4c35a8.zip
x86_32: introduce restore_fpu_checking()
Impact: cleanup, prepare FPU code unificaton Like on x86_64, return an error from restore_fpu and kill the task if it fails. Also rename restore_fpu to restore_fpu_checking which allows ifdefs to be removed in math_state_restore(). Signed-off-by: Jiri Slaby <jirislaby@gmail.com> LKML-Reference: <1239190320-23952-1-git-send-email-jirislaby@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/i387.h')
-rw-r--r--arch/x86/include/asm/i387.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index 71c9e5183982..09a2d6dfd85b 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -185,12 +185,10 @@ static inline void tolerant_fwait(void)
asm volatile("fnclex ; fwait");
}
-static inline void restore_fpu(struct task_struct *tsk)
+static inline int restore_fpu_checking(struct task_struct *tsk)
{
- if (task_thread_info(tsk)->status & TS_XSAVE) {
- xrstor_checking(&tsk->thread.xstate->xsave);
- return;
- }
+ if (task_thread_info(tsk)->status & TS_XSAVE)
+ return xrstor_checking(&tsk->thread.xstate->xsave);
/*
* The "nop" is needed to make the instructions the same
* length.
@@ -200,6 +198,7 @@ static inline void restore_fpu(struct task_struct *tsk)
"fxrstor %1",
X86_FEATURE_FXSR,
"m" (tsk->thread.xstate->fxsave));
+ return 0;
}
/* We need a safe address that is cheap to find and that is already
OpenPOWER on IntegriCloud