summaryrefslogtreecommitdiff
path: root/include/sysemu/hw_accel.h
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2017-01-10 11:59:55 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-19 22:07:46 +0100
commitb39466269b9b3c29b0c31c1320aa519f376b750f (patch)
tree32d21b76b0ef10c60be0cdcfccb28f228c3ac173 /include/sysemu/hw_accel.h
parent8c2b8ebf6ed993d1dc70691a601753f5957b4410 (diff)
downloadqemu-b39466269b9b3c29b0c31c1320aa519f376b750f.zip
kvm: move cpu synchronization code
Move the generic cpu_synchronize_ functions to the common hw_accel.h header, in order to prepare for the addition of a second hardware accelerator. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Message-Id: <f5c3cffe8d520011df1c2e5437bb814989b48332.1484045952.git.vpalatin@chromium.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/sysemu/hw_accel.h')
-rw-r--r--include/sysemu/hw_accel.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/sysemu/hw_accel.h b/include/sysemu/hw_accel.h
new file mode 100644
index 0000000000..03812cfeb3
--- /dev/null
+++ b/include/sysemu/hw_accel.h
@@ -0,0 +1,39 @@
+/*
+ * QEMU Hardware accelertors support
+ *
+ * Copyright 2016 Google, Inc.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef QEMU_HW_ACCEL_H
+#define QEMU_HW_ACCEL_H
+
+#include "qom/cpu.h"
+#include "sysemu/hax.h"
+#include "sysemu/kvm.h"
+
+static inline void cpu_synchronize_state(CPUState *cpu)
+{
+ if (kvm_enabled()) {
+ kvm_cpu_synchronize_state(cpu);
+ }
+}
+
+static inline void cpu_synchronize_post_reset(CPUState *cpu)
+{
+ if (kvm_enabled()) {
+ kvm_cpu_synchronize_post_reset(cpu);
+ }
+}
+
+static inline void cpu_synchronize_post_init(CPUState *cpu)
+{
+ if (kvm_enabled()) {
+ kvm_cpu_synchronize_post_init(cpu);
+ }
+}
+
+#endif /* QEMU_HW_ACCEL_H */