]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ia64/xen: short-circuit tests for dom0
authorIsaku Yamahata <yamahata@valinux.co.jp>
Wed, 4 Mar 2009 12:05:33 +0000 (21:05 +0900)
committerTony Luck <tony.luck@intel.com>
Thu, 26 Mar 2009 17:38:06 +0000 (10:38 -0700)
This patch is ia64 counter part of clean up of the xen predicates.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/include/asm/xen/hypervisor.h

index 7a804e80fc67d0c0aee90d0cbe13e365512d0570..e425227a418e9b15a40a0dce0d8f09be3061ec90 100644 (file)
@@ -33,9 +33,6 @@
 #ifndef _ASM_IA64_XEN_HYPERVISOR_H
 #define _ASM_IA64_XEN_HYPERVISOR_H
 
-#ifdef CONFIG_XEN
-
-#include <linux/init.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/version.h>     /* to compile feature.c */
 #include <xen/features.h>              /* to comiple xen-netfront.c */
 
 /* xen_domain_type is set before executing any C code by early_xen_setup */
 enum xen_domain_type {
-       XEN_NATIVE,
-       XEN_PV_DOMAIN,
-       XEN_HVM_DOMAIN,
+       XEN_NATIVE,     /* running on bare hardware */
+       XEN_PV_DOMAIN,  /* running in a PV domain */
+       XEN_HVM_DOMAIN, /* running in a Xen hvm domain*/
 };
 
+#ifdef CONFIG_XEN
 extern enum xen_domain_type xen_domain_type;
+#else
+#define xen_domain_type                XEN_NATIVE
+#endif
 
 #define xen_domain()           (xen_domain_type != XEN_NATIVE)
-#define xen_pv_domain()                (xen_domain_type == XEN_PV_DOMAIN)
-#define xen_initial_domain()   (xen_pv_domain() && \
+#define xen_pv_domain()                (xen_domain() &&                        \
+                                xen_domain_type == XEN_PV_DOMAIN)
+#define xen_hvm_domain()       (xen_domain() &&                        \
+                                xen_domain_type == XEN_HVM_DOMAIN)
+
+#ifdef CONFIG_XEN_DOM0
+#define xen_initial_domain()   (xen_pv_domain() &&                     \
                                 (xen_start_info->flags & SIF_INITDOMAIN))
-#define xen_hvm_domain()       (xen_domain_type == XEN_HVM_DOMAIN)
+#else
+#define xen_initial_domain()   (0)
+#endif
 
-/* deprecated. remove this */
-#define is_running_on_xen()    (xen_domain_type == XEN_PV_DOMAIN)
 
+#ifdef CONFIG_XEN
 extern struct shared_info *HYPERVISOR_shared_info;
 extern struct start_info *xen_start_info;
 
@@ -74,16 +81,6 @@ void force_evtchn_callback(void);
 
 /* For setup_arch() in arch/ia64/kernel/setup.c */
 void xen_ia64_enable_opt_feature(void);
-
-#else /* CONFIG_XEN */
-
-#define xen_domain()           (0)
-#define xen_pv_domain()                (0)
-#define xen_initial_domain()   (0)
-#define xen_hvm_domain()       (0)
-#define is_running_on_xen()    (0)     /* deprecated. remove this */
 #endif
 
-#define is_initial_xendomain() (0)     /* deprecated. remove this */
-
 #endif /* _ASM_IA64_XEN_HYPERVISOR_H */