mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-14 10:31:18 +00:00
cpus: Pass CPUState to cpu_can_run()
CPUArchState is no longer needed there. Also change its return type to bool. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
2fa45344a9
commit
a1fcaa73b1
14
cpus.c
14
cpus.c
@ -448,17 +448,15 @@ static void do_vm_stop(RunState state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cpu_can_run(CPUArchState *env)
|
static bool cpu_can_run(CPUState *cpu)
|
||||||
{
|
{
|
||||||
CPUState *cpu = ENV_GET_CPU(env);
|
|
||||||
|
|
||||||
if (cpu->stop) {
|
if (cpu->stop) {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
if (cpu->stopped || !runstate_is_running()) {
|
if (cpu->stopped || !runstate_is_running()) {
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_handle_guest_debug(CPUArchState *env)
|
static void cpu_handle_guest_debug(CPUArchState *env)
|
||||||
@ -756,7 +754,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
|
|||||||
qemu_cond_signal(&qemu_cpu_cond);
|
qemu_cond_signal(&qemu_cpu_cond);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (cpu_can_run(env)) {
|
if (cpu_can_run(cpu)) {
|
||||||
r = kvm_cpu_exec(env);
|
r = kvm_cpu_exec(env);
|
||||||
if (r == EXCP_DEBUG) {
|
if (r == EXCP_DEBUG) {
|
||||||
cpu_handle_guest_debug(env);
|
cpu_handle_guest_debug(env);
|
||||||
@ -1153,7 +1151,7 @@ static void tcg_exec_all(void)
|
|||||||
qemu_clock_enable(vm_clock,
|
qemu_clock_enable(vm_clock,
|
||||||
(env->singlestep_enabled & SSTEP_NOTIMER) == 0);
|
(env->singlestep_enabled & SSTEP_NOTIMER) == 0);
|
||||||
|
|
||||||
if (cpu_can_run(env)) {
|
if (cpu_can_run(cpu)) {
|
||||||
r = tcg_cpu_exec(env);
|
r = tcg_cpu_exec(env);
|
||||||
if (r == EXCP_DEBUG) {
|
if (r == EXCP_DEBUG) {
|
||||||
cpu_handle_guest_debug(env);
|
cpu_handle_guest_debug(env);
|
||||||
|
Loading…
Reference in New Issue
Block a user