Skip to content

Commit 18b8c47

Browse files
philmdrth7680
authored andcommitted
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é <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent a82fd5a commit 18b8c47

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

accel/tcg/tcg-accel-ops.c

+8-7
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,17 @@ static void tcg_accel_ops_init(AccelOpsClass *ops)
9797
ops->create_vcpu_thread = mttcg_start_vcpu_thread;
9898
ops->kick_vcpu_thread = mttcg_kick_vcpu_thread;
9999
ops->handle_interrupt = tcg_handle_interrupt;
100-
} else if (icount_enabled()) {
101-
ops->create_vcpu_thread = rr_start_vcpu_thread;
102-
ops->kick_vcpu_thread = rr_kick_vcpu_thread;
103-
ops->handle_interrupt = icount_handle_interrupt;
104-
ops->get_virtual_clock = icount_get;
105-
ops->get_elapsed_ticks = icount_get;
106100
} else {
107101
ops->create_vcpu_thread = rr_start_vcpu_thread;
108102
ops->kick_vcpu_thread = rr_kick_vcpu_thread;
109-
ops->handle_interrupt = tcg_handle_interrupt;
103+
104+
if (icount_enabled()) {
105+
ops->handle_interrupt = icount_handle_interrupt;
106+
ops->get_virtual_clock = icount_get;
107+
ops->get_elapsed_ticks = icount_get;
108+
} else {
109+
ops->handle_interrupt = tcg_handle_interrupt;
110+
}
110111
}
111112
}
112113

0 commit comments

Comments
 (0)