aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/i387.h
diff options
context:
space:
mode:
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-05-11 20:20:57 +0000
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>2005-05-11 20:20:57 +0000
commit475943e46a9123a544bd5755d20677eb92ea37f1 (patch)
treefbb0997db9f0a21f158b5ce257125a54160e204c /xen/include/asm-x86/i387.h
parent9d2218f4877423a1a132da4f2563614c681bdaa8 (diff)
downloadxen-475943e46a9123a544bd5755d20677eb92ea37f1.tar.gz
xen-475943e46a9123a544bd5755d20677eb92ea37f1.tar.bz2
xen-475943e46a9123a544bd5755d20677eb92ea37f1.zip
bitkeeper revision 1.1389.15.17 (42826929NzXOK9PSr4_HoDheSjVx3A)
vmx.h, i387.h, vmx_vmcs.c, vmx_io.c, vmx.c, traps.c: Implement a eager save/lazy restore algorithm for dealing with the FP state of a VMX guest. Signed-off-by: Xin B Li <xin.b.li@intel.com> Signed-off-by: Asit Mallick <asit.k.mallick@intel.com> Signed-off-by: Arun Sharma <arun.sharma@intel.com> Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Diffstat (limited to 'xen/include/asm-x86/i387.h')
-rw-r--r--xen/include/asm-x86/i387.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index ca81778089..01039ab648 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -28,4 +28,16 @@ extern void restore_fpu(struct exec_domain *tsk);
__asm__ __volatile__ ( "ldmxcsr %0" : : "m" (__mxcsr) ); \
} while ( 0 )
+/* Make domain the FPU owner */
+static inline void setup_fpu(struct exec_domain *ed)
+{
+ if ( !test_and_set_bit(EDF_USEDFPU, &ed->flags) )
+ {
+ if ( test_bit(EDF_DONEFPUINIT, &ed->flags) )
+ restore_fpu(ed);
+ else
+ init_fpu();
+ }
+}
+
#endif /* __ASM_I386_I387_H */