diff options
Diffstat (limited to 'include/asm-x86/xen/hypervisor.h')
-rw-r--r-- | include/asm-x86/xen/hypervisor.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/asm-x86/xen/hypervisor.h b/include/asm-x86/xen/hypervisor.h index 04ee0610014a..445a24759560 100644 --- a/include/asm-x86/xen/hypervisor.h +++ b/include/asm-x86/xen/hypervisor.h | |||
@@ -30,8 +30,8 @@ | |||
30 | * IN THE SOFTWARE. | 30 | * IN THE SOFTWARE. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #ifndef __HYPERVISOR_H__ | 33 | #ifndef ASM_X86__XEN__HYPERVISOR_H |
34 | #define __HYPERVISOR_H__ | 34 | #define ASM_X86__XEN__HYPERVISOR_H |
35 | 35 | ||
36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
37 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
@@ -54,7 +54,6 @@ | |||
54 | /* arch/i386/kernel/setup.c */ | 54 | /* arch/i386/kernel/setup.c */ |
55 | extern struct shared_info *HYPERVISOR_shared_info; | 55 | extern struct shared_info *HYPERVISOR_shared_info; |
56 | extern struct start_info *xen_start_info; | 56 | extern struct start_info *xen_start_info; |
57 | #define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN) | ||
58 | 57 | ||
59 | /* arch/i386/mach-xen/evtchn.c */ | 58 | /* arch/i386/mach-xen/evtchn.c */ |
60 | /* Force a proper event-channel callback from Xen. */ | 59 | /* Force a proper event-channel callback from Xen. */ |
@@ -67,6 +66,17 @@ u64 jiffies_to_st(unsigned long jiffies); | |||
67 | #define MULTI_UVMFLAGS_INDEX 3 | 66 | #define MULTI_UVMFLAGS_INDEX 3 |
68 | #define MULTI_UVMDOMID_INDEX 4 | 67 | #define MULTI_UVMDOMID_INDEX 4 |
69 | 68 | ||
70 | #define is_running_on_xen() (xen_start_info ? 1 : 0) | 69 | enum xen_domain_type { |
70 | XEN_NATIVE, | ||
71 | XEN_PV_DOMAIN, | ||
72 | XEN_HVM_DOMAIN, | ||
73 | }; | ||
71 | 74 | ||
72 | #endif /* __HYPERVISOR_H__ */ | 75 | extern enum xen_domain_type xen_domain_type; |
76 | |||
77 | #define xen_domain() (xen_domain_type != XEN_NATIVE) | ||
78 | #define xen_pv_domain() (xen_domain_type == XEN_PV_DOMAIN) | ||
79 | #define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags & SIF_INITDOMAIN) | ||
80 | #define xen_hvm_domain() (xen_domain_type == XEN_HVM_DOMAIN) | ||
81 | |||
82 | #endif /* ASM_X86__XEN__HYPERVISOR_H */ | ||