aboutsummaryrefslogtreecommitdiff
path: root/kvm.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-01-31 19:17:52 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2012-02-08 15:57:50 -0200
commit3d4b26494fdce89354dac49ef909356ccda77914 (patch)
tree50dae556e5fd2b3a18cd29731ee85c599d2b9260 /kvm.h
parent39d6960aabfd90bf0bf7ba38d69e918962b70b16 (diff)
kvm: Implement kvm_irqchip_in_kernel like kvm_enabled
To both avoid that kvm_irqchip_in_kernel always has to be paired with kvm_enabled and that the former ends up in a function call, implement it like the latter. This means keeping the state in a global variable and defining kvm_irqchip_in_kernel as a preprocessor macro. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm.h')
-rw-r--r--kvm.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/kvm.h b/kvm.h
index 40b5ffcfa3..f9f1dc86b3 100644
--- a/kvm.h
+++ b/kvm.h
@@ -23,11 +23,14 @@
#endif
extern int kvm_allowed;
+extern bool kvm_kernel_irqchip;
#if defined CONFIG_KVM || !defined NEED_CPU_H
-#define kvm_enabled() (kvm_allowed)
+#define kvm_enabled() (kvm_allowed)
+#define kvm_irqchip_in_kernel() (kvm_kernel_irqchip)
#else
-#define kvm_enabled() (0)
+#define kvm_enabled() (0)
+#define kvm_irqchip_in_kernel() (false)
#endif
struct kvm_run;
@@ -80,7 +83,6 @@ int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset);
#endif
int kvm_pit_in_kernel(void);
-int kvm_irqchip_in_kernel(void);
int kvm_on_sigbus_vcpu(CPUState *env, int code, void *addr);
int kvm_on_sigbus(int code, void *addr);