diff options
author | Philippe Mathieu-Daudé | 2022-03-23 18:17:44 +0100 |
---|---|---|
committer | Richard Henderson | 2022-06-20 22:11:36 +0200 |
commit | 18b8c47f8e66c1c45a0fb59cfd6ed4dfeb25c6f6 (patch) | |
tree | 458ba3b4793f02810971d8a14bcb0fde2a516edc /accel | |
parent | accel/tcg: Init TCG cflags in vCPU thread handler (diff) | |
download | qemu-18b8c47f8e66c1c45a0fb59cfd6ed4dfeb25c6f6.tar.gz qemu-18b8c47f8e66c1c45a0fb59cfd6ed4dfeb25c6f6.tar.xz qemu-18b8c47f8e66c1c45a0fb59cfd6ed4dfeb25c6f6.zip |
accel/tcg: Reorganize tcg_accel_ops_init()
Reorg TCG AccelOpsClass initialization to emphasis icount
mode share more code with single-threaded TCG.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220323171751.78612-7-philippe.mathieu.daude@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'accel')
-rw-r--r-- | accel/tcg/tcg-accel-ops.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 684dc5a137..786d90c08f 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -97,16 +97,17 @@ static void tcg_accel_ops_init(AccelOpsClass *ops) ops->create_vcpu_thread = mttcg_start_vcpu_thread; ops->kick_vcpu_thread = mttcg_kick_vcpu_thread; ops->handle_interrupt = tcg_handle_interrupt; - } else if (icount_enabled()) { - ops->create_vcpu_thread = rr_start_vcpu_thread; - ops->kick_vcpu_thread = rr_kick_vcpu_thread; - ops->handle_interrupt = icount_handle_interrupt; - ops->get_virtual_clock = icount_get; - ops->get_elapsed_ticks = icount_get; } else { ops->create_vcpu_thread = rr_start_vcpu_thread; ops->kick_vcpu_thread = rr_kick_vcpu_thread; - ops->handle_interrupt = tcg_handle_interrupt; + + if (icount_enabled()) { + ops->handle_interrupt = icount_handle_interrupt; + ops->get_virtual_clock = icount_get; + ops->get_elapsed_ticks = icount_get; + } else { + ops->handle_interrupt = tcg_handle_interrupt; + } } } |