xen: move Xen-testing predicates to common header
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>
This commit is contained in:
parent
9a08f7d350
commit
1ccbf5344c
|
@ -37,31 +37,4 @@
|
|||
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 */
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -21,7 +21,10 @@
|
|||
#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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -25,7 +25,10 @@
|
|||
#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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include <linux/notifier.h>
|
||||
|
||||
#include <xen/xen.h>
|
||||
#include <xen/xenbus.h>
|
||||
|
||||
#include <asm/xen/hypervisor.h>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include <linux/fs.h>
|
||||
#include <linux/magic.h>
|
||||
|
||||
#include <xen/xen.h>
|
||||
|
||||
#include "xenfs.h"
|
||||
|
||||
#include <asm/xen/hypervisor.h>
|
||||
|
|
|
@ -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 */
|
Loading…
Reference in New Issue