aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-02 23:10:09 +0200
committerAndreas Färber <afaerber@suse.de>2012-10-31 01:02:44 +0100
commit4fdeee7cd4c8f90ef765537b9346a195d9483ab5 (patch)
treeb8d4481845d7177097111d9d3ff69e4b495bf3d9 /cpus.c
parent61a4621784a808f5ad7d63f60e2c5e8b2488c213 (diff)
cpu: Move stop field to CPUState
Change its type to bool. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/cpus.c b/cpus.c
index 8abaa69d41..2341ebb68c 100644
--- a/cpus.c
+++ b/cpus.c
@@ -64,7 +64,9 @@ static CPUArchState *next_cpu;
static bool cpu_thread_is_idle(CPUArchState *env)
{
- if (env->stop || env->queued_work_first) {
+ CPUState *cpu = ENV_GET_CPU(env);
+
+ if (cpu->stop || env->queued_work_first) {
return false;
}
if (env->stopped || !runstate_is_running()) {
@@ -448,7 +450,9 @@ static void do_vm_stop(RunState state)
static int cpu_can_run(CPUArchState *env)
{
- if (env->stop) {
+ CPUState *cpu = ENV_GET_CPU(env);
+
+ if (cpu->stop) {
return 0;
}
if (env->stopped || !runstate_is_running()) {
@@ -687,8 +691,8 @@ static void qemu_wait_io_event_common(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
- if (env->stop) {
- env->stop = 0;
+ if (cpu->stop) {
+ cpu->stop = false;
env->stopped = 1;
qemu_cond_signal(&qemu_pause_cond);
}
@@ -941,7 +945,8 @@ void pause_all_vcpus(void)
qemu_clock_enable(vm_clock, false);
while (penv) {
- penv->stop = 1;
+ CPUState *pcpu = ENV_GET_CPU(penv);
+ pcpu->stop = true;
qemu_cpu_kick(penv);
penv = penv->next_cpu;
}
@@ -950,7 +955,8 @@ void pause_all_vcpus(void)
cpu_stop_current();
if (!kvm_enabled()) {
while (penv) {
- penv->stop = 0;
+ CPUState *pcpu = ENV_GET_CPU(penv);
+ pcpu->stop = 0;
penv->stopped = 1;
penv = penv->next_cpu;
}
@@ -974,7 +980,8 @@ void resume_all_vcpus(void)
qemu_clock_enable(vm_clock, true);
while (penv) {
- penv->stop = 0;
+ CPUState *pcpu = ENV_GET_CPU(penv);
+ pcpu->stop = false;
penv->stopped = 0;
qemu_cpu_kick(penv);
penv = penv->next_cpu;
@@ -1054,7 +1061,8 @@ void qemu_init_vcpu(void *_env)
void cpu_stop_current(void)
{
if (cpu_single_env) {
- cpu_single_env->stop = 0;
+ CPUState *cpu_single_cpu = ENV_GET_CPU(cpu_single_env);
+ cpu_single_cpu->stop = false;
cpu_single_env->stopped = 1;
cpu_exit(cpu_single_env);
qemu_cond_signal(&qemu_pause_cond);
@@ -1136,6 +1144,7 @@ static void tcg_exec_all(void)
}
for (; next_cpu != NULL && !exit_request; next_cpu = next_cpu->next_cpu) {
CPUArchState *env = next_cpu;
+ CPUState *cpu = ENV_GET_CPU(env);
qemu_clock_enable(vm_clock,
(env->singlestep_enabled & SSTEP_NOTIMER) == 0);
@@ -1146,7 +1155,7 @@ static void tcg_exec_all(void)
cpu_handle_guest_debug(env);
break;
}
- } else if (env->stop || env->stopped) {
+ } else if (cpu->stop || env->stopped) {
break;
}
}