mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
a82fd5a4ec
commit
18b8c47f8e
1 changed files with 8 additions and 7 deletions
|
@ -97,16 +97,17 @@ static void tcg_accel_ops_init(AccelOpsClass *ops)
|
||||||
ops->create_vcpu_thread = mttcg_start_vcpu_thread;
|
ops->create_vcpu_thread = mttcg_start_vcpu_thread;
|
||||||
ops->kick_vcpu_thread = mttcg_kick_vcpu_thread;
|
ops->kick_vcpu_thread = mttcg_kick_vcpu_thread;
|
||||||
ops->handle_interrupt = tcg_handle_interrupt;
|
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 {
|
} else {
|
||||||
ops->create_vcpu_thread = rr_start_vcpu_thread;
|
ops->create_vcpu_thread = rr_start_vcpu_thread;
|
||||||
ops->kick_vcpu_thread = rr_kick_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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue