]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
linux/x86: don't hardcode is_running_on_xen() for pv-on-hvm drivers
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 7 Feb 2008 10:33:19 +0000 (10:33 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 7 Feb 2008 10:33:19 +0000 (10:33 +0000)
Allowing graceful failure of these modules when inadvertently loaded
on native kernels.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
include/asm-i386/mach-xen/asm/hypervisor.h

index 6e31492b4ad0d4d4f99d4c08aff30dbc7cb795a3..5aaa5f30fe86a6ef6ca1db08f572c8876aa9077c 100644 (file)
@@ -145,7 +145,12 @@ u64 jiffies_to_st(unsigned long jiffies);
 #define MULTI_UVMDOMID_INDEX 4
 #endif
 
+#ifdef CONFIG_XEN
 #define is_running_on_xen() 1
+#else
+extern char *hypercall_stubs;
+#define is_running_on_xen() (!!hypercall_stubs)
+#endif
 
 static inline int
 HYPERVISOR_yield(