From 5806e2df7f5dd8b4b67140d70425b878eb694556 Mon Sep 17 00:00:00 2001 From: kmacy Date: Fri, 15 Aug 2008 21:43:38 +0000 Subject: Call in to xen for fpu handling when XEN is set MFC after: 1 month --- sys/i386/isa/npx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sys') 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 #include +#ifdef XEN +#include +#include +#endif + #ifdef DEV_ISA #include #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); -- cgit v1.1