summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-08-15 21:43:38 +0000
committerkmacy <kmacy@FreeBSD.org>2008-08-15 21:43:38 +0000
commit5806e2df7f5dd8b4b67140d70425b878eb694556 (patch)
tree24efa2a33f8fbe28e19b596fd3b6dfd42e5ccc06 /sys
parent7f5780e2e4f44512c072ec6976aeb76fbc5c731b (diff)
downloadFreeBSD-src-5806e2df7f5dd8b4b67140d70425b878eb694556.zip
FreeBSD-src-5806e2df7f5dd8b4b67140d70425b878eb694556.tar.gz
Call in to xen for fpu handling when XEN is set
MFC after: 1 month
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/isa/npx.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index c5d381e..6be3da9 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -68,6 +68,11 @@ __FBSDID("$FreeBSD$");
#include <machine/ucontext.h>
#include <machine/intr_machdep.h>
+#ifdef XEN
+#include <machine/xen/xen-os.h>
+#include <machine/xen/hypervisor.h>
+#endif
+
#ifdef DEV_ISA
#include <isa/isavar.h>
#endif
@@ -100,10 +105,14 @@ __FBSDID("$FreeBSD$");
#define fxsave(addr) __asm __volatile("fxsave %0" : "=m" (*(addr)))
#define ldmxcsr(__csr) __asm __volatile("ldmxcsr %0" : : "m" (__csr))
#endif
+#ifdef XEN
+#define start_emulating() (HYPERVISOR_fpu_taskswitch(1))
+#define stop_emulating() (HYPERVISOR_fpu_taskswitch(0))
+#else
#define start_emulating() __asm("smsw %%ax; orb %0,%%al; lmsw %%ax" \
: : "n" (CR0_TS) : "ax")
#define stop_emulating() __asm("clts")
-
+#endif
#else /* !(__GNUCLIKE_ASM && !lint) */
void fldcw(caddr_t addr);
OpenPOWER on IntegriCloud