diff options
author | Andreas Färber <afaerber@suse.de> | 2012-05-02 22:49:36 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-10-31 01:02:44 +0100 |
commit | 61a4621784a808f5ad7d63f60e2c5e8b2488c213 (patch) | |
tree | 1dd2b7a47e786f253f29afb84433789b62c08e73 /cpus.c | |
parent | 2ff09a40a8399a6f9807ebdb72423ec0a581c3b3 (diff) | |
download | qemu-61a4621784a808f5ad7d63f60e2c5e8b2488c213.zip qemu-61a4621784a808f5ad7d63f60e2c5e8b2488c213.tar.gz qemu-61a4621784a808f5ad7d63f60e2c5e8b2488c213.tar.bz2 |
cpu: Move created 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.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -746,7 +746,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) qemu_kvm_init_cpu_signals(env); /* signal CPU creation */ - env->created = 1; + cpu->created = true; qemu_cond_signal(&qemu_cpu_cond); while (1) { @@ -781,7 +781,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg) sigaddset(&waitset, SIG_IPI); /* signal CPU creation */ - env->created = 1; + cpu->created = true; qemu_cond_signal(&qemu_cpu_cond); cpu_single_env = env; @@ -818,8 +818,9 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) /* signal CPU creation */ qemu_mutex_lock(&qemu_global_mutex); for (env = first_cpu; env != NULL; env = env->next_cpu) { + cpu = ENV_GET_CPU(env); env->thread_id = qemu_get_thread_id(); - env->created = 1; + cpu->created = true; } qemu_cond_signal(&qemu_cpu_cond); @@ -996,7 +997,7 @@ static void qemu_tcg_init_vcpu(void *_env) #ifdef _WIN32 cpu->hThread = qemu_thread_get_handle(cpu->thread); #endif - while (env->created == 0) { + while (!cpu->created) { qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); } tcg_cpu_thread = cpu->thread; @@ -1015,7 +1016,7 @@ static void qemu_kvm_start_vcpu(CPUArchState *env) qemu_cond_init(env->halt_cond); qemu_thread_create(cpu->thread, qemu_kvm_cpu_thread_fn, env, QEMU_THREAD_JOINABLE); - while (env->created == 0) { + while (!cpu->created) { qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); } } @@ -1029,7 +1030,7 @@ static void qemu_dummy_start_vcpu(CPUArchState *env) qemu_cond_init(env->halt_cond); qemu_thread_create(cpu->thread, qemu_dummy_cpu_thread_fn, env, QEMU_THREAD_JOINABLE); - while (env->created == 0) { + while (!cpu->created) { qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex); } } |