diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-08-19 16:16:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-20 06:40:07 -0400 |
commit | 6e833587e11ed0dbf12e647127f2650e2f80b26d (patch) | |
tree | 7ba3d76705547ed1377f87694e0b0e4391fe0015 /include/asm-x86/xen | |
parent | 170465ee7f5a9a2d0ac71285507e52642e040353 (diff) |
xen: clean up domain mode predicates
There are four operating modes Xen code may find itself running in:
- native
- hvm domain
- pv dom0
- pv domU
Clean up predicates for testing for these states to make them more consistent.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Xen-devel <xen-devel@lists.xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/xen')
-rw-r--r-- | include/asm-x86/xen/hypervisor.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/asm-x86/xen/hypervisor.h b/include/asm-x86/xen/hypervisor.h index 8e15dd28c91f..d9dd28caa508 100644 --- a/include/asm-x86/xen/hypervisor.h +++ b/include/asm-x86/xen/hypervisor.h | |||
@@ -55,7 +55,6 @@ | |||
55 | /* arch/i386/kernel/setup.c */ | 55 | /* arch/i386/kernel/setup.c */ |
56 | extern struct shared_info *HYPERVISOR_shared_info; | 56 | extern struct shared_info *HYPERVISOR_shared_info; |
57 | extern struct start_info *xen_start_info; | 57 | extern struct start_info *xen_start_info; |
58 | #define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN) | ||
59 | 58 | ||
60 | /* arch/i386/mach-xen/evtchn.c */ | 59 | /* arch/i386/mach-xen/evtchn.c */ |
61 | /* Force a proper event-channel callback from Xen. */ | 60 | /* Force a proper event-channel callback from Xen. */ |
@@ -68,6 +67,17 @@ u64 jiffies_to_st(unsigned long jiffies); | |||
68 | #define MULTI_UVMFLAGS_INDEX 3 | 67 | #define MULTI_UVMFLAGS_INDEX 3 |
69 | #define MULTI_UVMDOMID_INDEX 4 | 68 | #define MULTI_UVMDOMID_INDEX 4 |
70 | 69 | ||
71 | #define is_running_on_xen() (xen_start_info ? 1 : 0) | 70 | enum xen_domain_type { |
71 | XEN_NATIVE, | ||
72 | XEN_PV_DOMAIN, | ||
73 | XEN_HVM_DOMAIN, | ||
74 | }; | ||
75 | |||
76 | extern enum xen_domain_type xen_domain_type; | ||
77 | |||
78 | #define xen_domain() (xen_domain_type != XEN_NATIVE) | ||
79 | #define xen_pv_domain() (xen_domain_type == XEN_PV_DOMAIN) | ||
80 | #define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags & SIF_INITDOMAIN) | ||
81 | #define xen_hvm_domain() (xen_domain_type == XEN_HVM_DOMAIN) | ||
72 | 82 | ||
73 | #endif /* __HYPERVISOR_H__ */ | 83 | #endif /* __HYPERVISOR_H__ */ |