x86/virt: Add enum for hypervisors to replace x86_hyper
[linux-2.6-block.git] / arch / x86 / include / asm / hypervisor.h
index 0eca7239a7aadee920ade2b3eab5e99adaa2fca2..1b0a5abcd8aeb6e700013c5434aaeb0bba7a152f 100644 (file)
 /*
  * x86 hypervisor information
  */
+
+enum x86_hypervisor_type {
+       X86_HYPER_NATIVE = 0,
+       X86_HYPER_VMWARE,
+       X86_HYPER_MS_HYPERV,
+       X86_HYPER_XEN_PV,
+       X86_HYPER_XEN_HVM,
+       X86_HYPER_KVM,
+};
+
 struct hypervisor_x86 {
        /* Hypervisor name */
        const char      *name;
@@ -36,6 +46,9 @@ struct hypervisor_x86 {
        /* Detection routine */
        uint32_t        (*detect)(void);
 
+       /* Hypervisor type */
+       enum x86_hypervisor_type type;
+
        /* init time callbacks */
        struct x86_hyper_init init;
 
@@ -43,15 +56,7 @@ struct hypervisor_x86 {
        struct x86_hyper_runtime runtime;
 };
 
-extern const struct hypervisor_x86 *x86_hyper;
-
-/* Recognized hypervisors */
-extern const struct hypervisor_x86 x86_hyper_vmware;
-extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
-extern const struct hypervisor_x86 x86_hyper_xen_pv;
-extern const struct hypervisor_x86 x86_hyper_xen_hvm;
-extern const struct hypervisor_x86 x86_hyper_kvm;
-
+extern enum x86_hypervisor_type x86_hyper_type;
 extern void init_hypervisor_platform(void);
 #else
 static inline void init_hypervisor_platform(void) { }