aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/i387.h
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-10 16:59:06 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-10 16:59:06 +0000
commit7f68576b77ef3c9fde1009100690ff996d4490e0 (patch)
tree6a87f66c7a03042baa556676add65252816fbd94 /xen/include/asm-x86/i387.h
parent822a0b35350d8006b808000eef3665ee4df7b297 (diff)
downloadxen-7f68576b77ef3c9fde1009100690ff996d4490e0.tar.gz
xen-7f68576b77ef3c9fde1009100690ff996d4490e0.tar.bz2
xen-7f68576b77ef3c9fde1009100690ff996d4490e0.zip
bitkeeper revision 1.952 (40c8935a3XSRdQfnx5RoO7XgaggvOQ)
Towards x86_64 support. Merged a bunch of the existing x86_64 stuff back into a generic 'x86' architecture. Aim is to share as much as possible between 32- and 64-bit worlds.
Diffstat (limited to 'xen/include/asm-x86/i387.h')
-rw-r--r--xen/include/asm-x86/i387.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
new file mode 100644
index 0000000000..95a6bb6cde
--- /dev/null
+++ b/xen/include/asm-x86/i387.h
@@ -0,0 +1,38 @@
+/*
+ * include/asm-i386/i387.h
+ *
+ * Copyright (C) 1994 Linus Torvalds
+ *
+ * Pentium III FXSR, SSE support
+ * General FPU state handling cleanups
+ * Gareth Hughes <gareth@valinux.com>, May 2000
+ */
+
+#ifndef __ASM_I386_I387_H
+#define __ASM_I386_I387_H
+
+#include <xen/sched.h>
+#include <asm/processor.h>
+
+extern void init_fpu(void);
+extern void save_init_fpu( struct task_struct *tsk );
+extern void restore_fpu( struct task_struct *tsk );
+
+#define unlazy_fpu( tsk ) do { \
+ if ( test_bit(PF_USEDFPU, &tsk->flags) ) \
+ save_init_fpu( tsk ); \
+} while (0)
+
+#define clear_fpu( tsk ) do { \
+ if ( test_and_clear_bit(PF_USEDFPU, &tsk->flags) ) { \
+ asm volatile("fwait"); \
+ stts(); \
+ } \
+} while (0)
+
+#define load_mxcsr( val ) do { \
+ unsigned long __mxcsr = ((unsigned long)(val) & 0xffbf); \
+ asm volatile( "ldmxcsr %0" : : "m" (__mxcsr) ); \
+} while (0)
+
+#endif /* __ASM_I386_I387_H */