xen: move Xen-testing predicates to common header
authorJeremy Fitzhardinge <jeremy@goop.org>
Tue, 6 Oct 2009 22:11:14 +0000 (15:11 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 4 Nov 2009 16:47:24 +0000 (08:47 -0800)
Move xen_domain and related tests out of asm-x86 to xen/xen.h so they
can be included whenever they are necessary.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 files changed:
arch/x86/include/asm/xen/hypervisor.h
arch/x86/xen/enlighten.c
drivers/block/xen-blkfront.c
drivers/char/hvc_xen.c
drivers/input/xen-kbdfront.c
drivers/net/xen-netfront.c
drivers/video/xen-fbfront.c
drivers/xen/balloon.c
drivers/xen/cpu_hotplug.c
drivers/xen/evtchn.c
drivers/xen/grant-table.c
drivers/xen/sys-hypervisor.c
drivers/xen/xenbus/xenbus_probe.c
drivers/xen/xenfs/super.c
include/xen/xen.h [new file with mode: 0644]

index d5b7e90c0edfd3ca1bf7d05e3f4c4e642f8e6fb7..396ff4cc8ed480b7bc306f63091b88f6dda00442 100644 (file)
 extern struct shared_info *HYPERVISOR_shared_info;
 extern struct start_info *xen_start_info;
 
-enum xen_domain_type {
-       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() &&                        \
-                                xen_domain_type == XEN_PV_DOMAIN)
-#define xen_hvm_domain()       (xen_domain() &&                        \
-                                xen_domain_type == XEN_HVM_DOMAIN)
-
-#ifdef CONFIG_XEN_DOM0
-#include <xen/interface/xen.h>
-
-#define xen_initial_domain()   (xen_pv_domain() && \
-                                xen_start_info->flags & SIF_INITDOMAIN)
-#else  /* !CONFIG_XEN_DOM0 */
-#define xen_initial_domain()   (0)
-#endif /* CONFIG_XEN_DOM0 */
-
 #endif /* _ASM_X86_XEN_HYPERVISOR_H */
index 23a4d80fb39e80a496bcd847e5de6d0886255fc3..5bccd706232c21c3cae9afbf97242fdfe2ad60af 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/highmem.h>
 #include <linux/console.h>
 
+#include <xen/xen.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/version.h>
 #include <xen/interface/physdev.h>
index b8578bb3f4c9c4393c83be80ddaa36eccc073264..05a31e55d27817bed3f8157c91389c31f0adb1f8 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/module.h>
 #include <linux/scatterlist.h>
 
+#include <xen/xen.h>
 #include <xen/xenbus.h>
 #include <xen/grant_table.h>
 #include <xen/events.h>
index eba999f8598d07a8a29fe03bac5bb4de18d39f62..93d33816c9d9d96378041252e50810fc2d3d115b 100644 (file)
@@ -25,6 +25,8 @@
 #include <linux/types.h>
 
 #include <asm/xen/hypervisor.h>
+
+#include <xen/xen.h>
 #include <xen/page.h>
 #include <xen/events.h>
 #include <xen/interface/io/console.h>
index b115726dc088b169003a725ba29de8a4171e58a9..c721c0a23eb831d20672e16120b3278e8901f428 100644 (file)
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/input.h>
+
 #include <asm/xen/hypervisor.h>
+
+#include <xen/xen.h>
 #include <xen/events.h>
 #include <xen/page.h>
 #include <xen/interface/io/fbif.h>
index baa051d5bfbe0bcd84bd9f28530ac73f6d4863d8..a869b45d3d37b2f38a986c4dfb0146d10be4416d 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/mm.h>
 #include <net/ip.h>
 
+#include <xen/xen.h>
 #include <xen/xenbus.h>
 #include <xen/events.h>
 #include <xen/page.h>
index 54cd916101744ff7c5c1c21d68d4d4f6b028f066..966b226c858cab3a63ecc7f0b11190c596029e77 100644 (file)
 #include <linux/module.h>
 #include <linux/vmalloc.h>
 #include <linux/mm.h>
+
 #include <asm/xen/hypervisor.h>
+
+#include <xen/xen.h>
 #include <xen/events.h>
 #include <xen/page.h>
 #include <xen/interface/io/fbif.h>
index d31505b6f7a465fd965257210da53466cc83e34e..826dda414166ac8358d99fe15ccff8c46b926d39 100644 (file)
@@ -52,6 +52,8 @@
 
 #include <asm/xen/hypervisor.h>
 #include <asm/xen/hypercall.h>
+
+#include <xen/xen.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/memory.h>
 #include <xen/xenbus.h>
index bdfd584ad853ac379e0b3ed9975034e86faa27c4..6625ffe1a6fd9fb21c905be8c11b879d7efed501 100644 (file)
@@ -1,5 +1,6 @@
 #include <linux/notifier.h>
 
+#include <xen/xen.h>
 #include <xen/xenbus.h>
 
 #include <asm/xen/hypervisor.h>
index 79bedba44feef5651177f10c2e3469e98a089e9a..f70a4f4698c5994348a14dd216bb91ad72ec5b6a 100644 (file)
@@ -48,6 +48,8 @@
 #include <linux/gfp.h>
 #include <linux/mutex.h>
 #include <linux/cpu.h>
+
+#include <xen/xen.h>
 #include <xen/events.h>
 #include <xen/evtchn.h>
 #include <asm/xen/hypervisor.h>
index 7d8f531fb8e8a60a342f2fce3f2168fe5127db39..4c6c0bd636a8073ab743dbcc2a643d3ea7fd73a0 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/vmalloc.h>
 #include <linux/uaccess.h>
 
+#include <xen/xen.h>
 #include <xen/interface/xen.h>
 #include <xen/page.h>
 #include <xen/grant_table.h>
index 88a60e03ccf079f40c1bab8f4da18d03720d5955..ae5cb05a1a1cb01cd4777d84b66ea3ba84e98c8a 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/xen/hypervisor.h>
 #include <asm/xen/hypercall.h>
 
+#include <xen/xen.h>
 #include <xen/xenbus.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/version.h>
index d42e25d5968dcf48acd5448a7a6af56d21abd5fb..08638adec9fce15b9b4ec86efd4f7aa5ad47d941 100644 (file)
@@ -49,6 +49,8 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/xen/hypervisor.h>
+
+#include <xen/xen.h>
 #include <xen/xenbus.h>
 #include <xen/events.h>
 #include <xen/page.h>
index 6559e0c752ce1494baa127921834e388832cbd75..8924d93136f152a7dd6b84d267db3162a4ff739b 100644 (file)
@@ -13,6 +13,8 @@
 #include <linux/fs.h>
 #include <linux/magic.h>
 
+#include <xen/xen.h>
+
 #include "xenfs.h"
 
 #include <asm/xen/hypervisor.h>
diff --git a/include/xen/xen.h b/include/xen/xen.h
new file mode 100644 (file)
index 0000000..a164024
--- /dev/null
@@ -0,0 +1,32 @@
+#ifndef _XEN_XEN_H
+#define _XEN_XEN_H
+
+enum xen_domain_type {
+       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() &&                        \
+                                xen_domain_type == XEN_PV_DOMAIN)
+#define xen_hvm_domain()       (xen_domain() &&                        \
+                                xen_domain_type == XEN_HVM_DOMAIN)
+
+#ifdef CONFIG_XEN_DOM0
+#include <xen/interface/xen.h>
+#include <asm/xen/hypervisor.h>
+
+#define xen_initial_domain()   (xen_pv_domain() && \
+                                xen_start_info->flags & SIF_INITDOMAIN)
+#else  /* !CONFIG_XEN_DOM0 */
+#define xen_initial_domain()   (0)
+#endif /* CONFIG_XEN_DOM0 */
+
+#endif /* _XEN_XEN_H */