Linux 4.13.16
[linux/fpc-iii.git] / include / xen / xen.h
blob6e8b7fc798017e4c13188339cf83b1e68fcd16e4
1 #ifndef _XEN_XEN_H
2 #define _XEN_XEN_H
4 enum xen_domain_type {
5 XEN_NATIVE, /* running on bare hardware */
6 XEN_PV_DOMAIN, /* running in a PV domain */
7 XEN_HVM_DOMAIN, /* running in a Xen hvm domain */
8 };
10 #ifdef CONFIG_XEN
11 extern enum xen_domain_type xen_domain_type;
12 #else
13 #define xen_domain_type XEN_NATIVE
14 #endif
16 #define xen_domain() (xen_domain_type != XEN_NATIVE)
17 #define xen_pv_domain() (xen_domain() && \
18 xen_domain_type == XEN_PV_DOMAIN)
19 #define xen_hvm_domain() (xen_domain() && \
20 xen_domain_type == XEN_HVM_DOMAIN)
22 #ifdef CONFIG_XEN_DOM0
23 #include <xen/interface/xen.h>
24 #include <asm/xen/hypervisor.h>
26 #define xen_initial_domain() (xen_domain() && \
27 xen_start_info && xen_start_info->flags & SIF_INITDOMAIN)
28 #else /* !CONFIG_XEN_DOM0 */
29 #define xen_initial_domain() (0)
30 #endif /* CONFIG_XEN_DOM0 */
32 #ifdef CONFIG_XEN_PVH
33 extern bool xen_pvh;
34 #define xen_pvh_domain() (xen_hvm_domain() && xen_pvh)
35 #else
36 #define xen_pvh_domain() (0)
37 #endif
39 #endif /* _XEN_XEN_H */