File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change 20
20
#ifndef _ASM_X86_HYPERVISOR_H
21
21
#define _ASM_X86_HYPERVISOR_H
22
22
23
- #ifdef CONFIG_HYPERVISOR_GUEST
24
-
25
- #include <asm/kvm_para.h>
26
- #include <asm/x86_init.h>
27
- #include <asm/xen/hypervisor.h>
28
-
29
- /*
30
- * x86 hypervisor information
31
- */
32
-
23
+ /* x86 hypervisor types */
33
24
enum x86_hypervisor_type {
34
25
X86_HYPER_NATIVE = 0 ,
35
26
X86_HYPER_VMWARE ,
@@ -39,6 +30,12 @@ enum x86_hypervisor_type {
39
30
X86_HYPER_KVM ,
40
31
};
41
32
33
+ #ifdef CONFIG_HYPERVISOR_GUEST
34
+
35
+ #include <asm/kvm_para.h>
36
+ #include <asm/x86_init.h>
37
+ #include <asm/xen/hypervisor.h>
38
+
42
39
struct hypervisor_x86 {
43
40
/* Hypervisor name */
44
41
const char * name ;
@@ -58,7 +55,15 @@ struct hypervisor_x86 {
58
55
59
56
extern enum x86_hypervisor_type x86_hyper_type ;
60
57
extern void init_hypervisor_platform (void );
58
+ static inline bool hypervisor_is_type (enum x86_hypervisor_type type )
59
+ {
60
+ return x86_hyper_type == type ;
61
+ }
61
62
#else
62
63
static inline void init_hypervisor_platform (void ) { }
64
+ static inline bool hypervisor_is_type (enum x86_hypervisor_type type )
65
+ {
66
+ return type == X86_HYPER_NATIVE ;
67
+ }
63
68
#endif /* CONFIG_HYPERVISOR_GUEST */
64
69
#endif /* _ASM_X86_HYPERVISOR_H */
You can’t perform that action at this time.
0 commit comments