aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/hypervisor.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/hypervisor.h')
-rw-r--r--arch/x86/include/asm/hypervisor.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/x86/include/asm/hypervisor.h b/arch/x86/include/asm/hypervisor.h
index 0eca7239a7aa..1b0a5abcd8ae 100644
--- a/arch/x86/include/asm/hypervisor.h
+++ b/arch/x86/include/asm/hypervisor.h
@@ -29,6 +29,16 @@
29/* 29/*
30 * x86 hypervisor information 30 * x86 hypervisor information
31 */ 31 */
32
33enum x86_hypervisor_type {
34 X86_HYPER_NATIVE = 0,
35 X86_HYPER_VMWARE,
36 X86_HYPER_MS_HYPERV,
37 X86_HYPER_XEN_PV,
38 X86_HYPER_XEN_HVM,
39 X86_HYPER_KVM,
40};
41
32struct hypervisor_x86 { 42struct hypervisor_x86 {
33 /* Hypervisor name */ 43 /* Hypervisor name */
34 const char *name; 44 const char *name;
@@ -36,6 +46,9 @@ struct hypervisor_x86 {
36 /* Detection routine */ 46 /* Detection routine */
37 uint32_t (*detect)(void); 47 uint32_t (*detect)(void);
38 48
49 /* Hypervisor type */
50 enum x86_hypervisor_type type;
51
39 /* init time callbacks */ 52 /* init time callbacks */
40 struct x86_hyper_init init; 53 struct x86_hyper_init init;
41 54
@@ -43,15 +56,7 @@ struct hypervisor_x86 {
43 struct x86_hyper_runtime runtime; 56 struct x86_hyper_runtime runtime;
44}; 57};
45 58
46extern const struct hypervisor_x86 *x86_hyper; 59extern enum x86_hypervisor_type x86_hyper_type;
47
48/* Recognized hypervisors */
49extern const struct hypervisor_x86 x86_hyper_vmware;
50extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
51extern const struct hypervisor_x86 x86_hyper_xen_pv;
52extern const struct hypervisor_x86 x86_hyper_xen_hvm;
53extern const struct hypervisor_x86 x86_hyper_kvm;
54
55extern void init_hypervisor_platform(void); 60extern void init_hypervisor_platform(void);
56#else 61#else
57static inline void init_hypervisor_platform(void) { } 62static inline void init_hypervisor_platform(void) { }