aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/i387.c
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-22 23:04:40 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2005-02-22 23:04:40 +0000
commit4ddaeb24b5eb996bba6b05e69b5c6584fb1fcc3f (patch)
tree7f48fbce691000f79d9d9f5ea2e941a75235c0ea /xen/arch/x86/i387.c
parent2a022479a2cf44b2de5b79bc1865d7224eb79d0c (diff)
downloadxen-4ddaeb24b5eb996bba6b05e69b5c6584fb1fcc3f.tar.gz
xen-4ddaeb24b5eb996bba6b05e69b5c6584fb1fcc3f.tar.bz2
xen-4ddaeb24b5eb996bba6b05e69b5c6584fb1fcc3f.zip
bitkeeper revision 1.1236.1.1 (421bba88ZaitlU4qEVN6Xp2WKaq8Vg)
FPU fixes. Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/arch/x86/i387.c')
-rw-r--r--xen/arch/x86/i387.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 902da0b57f..5aa6b59707 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -16,42 +16,43 @@
void init_fpu(void)
{
- __asm__("fninit");
- if ( cpu_has_xmm ) load_mxcsr(0x1f80);
+ __asm__ __volatile__ ( "fninit" );
+ if ( cpu_has_xmm )
+ load_mxcsr(0x1f80);
set_bit(EDF_DONEFPUINIT, &current->ed_flags);
}
-static inline void __save_init_fpu( struct exec_domain *tsk )
-{
- if ( cpu_has_fxsr ) {
- asm volatile( "fxsave %0 ; fnclex"
- : "=m" (tsk->arch.i387) );
- } else {
- asm volatile( "fnsave %0 ; fwait"
- : "=m" (tsk->arch.i387) );
- }
- clear_bit(EDF_USEDFPU, &tsk->ed_flags);
-}
-
-void save_init_fpu( struct exec_domain *tsk )
+void save_init_fpu(struct exec_domain *tsk)
{
/*
* The guest OS may have set the 'virtual STTS' flag.
* This causes us to set the real flag, so we'll need
* to temporarily clear it while saving f-p state.
*/
- if ( test_bit(EDF_GUEST_STTS, &tsk->ed_flags) ) clts();
- __save_init_fpu(tsk);
+ if ( test_bit(EDF_GUEST_STTS, &tsk->ed_flags) )
+ clts();
+
+ if ( cpu_has_fxsr )
+ __asm__ __volatile__ (
+ "fxsave %0 ; fnclex"
+ : "=m" (tsk->arch.i387) );
+ else
+ __asm__ __volatile__ (
+ "fnsave %0 ; fwait"
+ : "=m" (tsk->arch.i387) );
+
+ clear_bit(EDF_USEDFPU, &tsk->ed_flags);
stts();
}
-void restore_fpu( struct exec_domain *tsk )
+void restore_fpu(struct exec_domain *tsk)
{
- if ( cpu_has_fxsr ) {
- asm volatile( "fxrstor %0"
- : : "m" (tsk->arch.i387) );
- } else {
- asm volatile( "frstor %0"
- : : "m" (tsk->arch.i387) );
- }
+ if ( cpu_has_fxsr )
+ __asm__ __volatile__ (
+ "fxrstor %0"
+ : : "m" (tsk->arch.i387) );
+ else
+ __asm__ __volatile__ (
+ "frstor %0"
+ : : "m" (tsk->arch.i387) );
}