aboutsummaryrefslogtreecommitdiff
path: root/accel/tcg/tcg-all.c
diff options
context:
space:
mode:
authorClaudio Fontana <cfontana@suse.de>2020-07-06 19:39:45 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-10-05 16:41:22 +0200
commita77dabc33bcc36ec348854f23e89e0de22ca045b (patch)
tree0f5ef16d52f342cc0e389d3f952da7475dc06aef /accel/tcg/tcg-all.c
parent430065dab060f04a74f915ea1260dcc79701ca75 (diff)
cpus: extract out TCG-specific code to accel/tcg
TCG is the first accelerator to register a "CpusAccel" interface on initialization, providing functions for starting a vcpu, kicking a vcpu, sychronizing state and getting virtual clock and ticks. Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> [added const] Signed-off-by: Claudio Fontana <cfontana@suse.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel/tcg/tcg-all.c')
-rw-r--r--accel/tcg/tcg-all.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c
index 2d13df3f72..000fe4dbd9 100644
--- a/accel/tcg/tcg-all.c
+++ b/accel/tcg/tcg-all.c
@@ -24,18 +24,15 @@
*/
#include "qemu/osdep.h"
-#include "sysemu/accel.h"
+#include "qemu-common.h"
#include "sysemu/tcg.h"
-#include "qom/object.h"
-#include "cpu.h"
-#include "sysemu/cpus.h"
#include "sysemu/cpu-timers.h"
-#include "qemu/main-loop.h"
#include "tcg/tcg.h"
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "hw/boards.h"
#include "qapi/qapi-builtin-visit.h"
+#include "tcg-cpus.h"
struct TCGState {
AccelState parent_obj;
@@ -124,6 +121,8 @@ static void tcg_accel_instance_init(Object *obj)
s->mttcg_enabled = default_mttcg_enabled();
}
+bool mttcg_enabled;
+
static int tcg_init(MachineState *ms)
{
TCGState *s = TCG_STATE(current_accel());
@@ -131,6 +130,8 @@ static int tcg_init(MachineState *ms)
tcg_exec_init(s->tb_size * 1024 * 1024);
cpu_interrupt_handler = tcg_handle_interrupt;
mttcg_enabled = s->mttcg_enabled;
+ cpus_register_accel(&tcg_cpus);
+
return 0;
}