[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/35] cpus: Pass CPUState to cpu_is_stopped()
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 13/35] cpus: Pass CPUState to cpu_is_stopped() |
Date: |
Wed, 31 Oct 2012 01:59:44 +0100 |
CPUArchState is no longer needed there.
Also change the return type to bool.
Signed-off-by: Andreas Färber <address@hidden>
---
cpu-all.h | 1 -
cpus.c | 4 +---
include/qemu/cpu.h | 11 +++++++++++
target-i386/kvm.c | 4 ++--
4 Dateien geändert, 14 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)
diff --git a/cpu-all.h b/cpu-all.h
index 6606432..d19ec12 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -466,7 +466,6 @@ void cpu_watchpoint_remove_all(CPUArchState *env, int mask);
#define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */
void cpu_single_step(CPUArchState *env, int enabled);
-int cpu_is_stopped(CPUArchState *env);
void run_on_cpu(CPUArchState *env, void (*func)(void *data), void *data);
#if !defined(CONFIG_USER_ONLY)
diff --git a/cpus.c b/cpus.c
index 4654f08..0721a96 100644
--- a/cpus.c
+++ b/cpus.c
@@ -430,10 +430,8 @@ void cpu_synchronize_all_post_init(void)
}
}
-int cpu_is_stopped(CPUArchState *env)
+bool cpu_is_stopped(CPUState *cpu)
{
- CPUState *cpu = ENV_GET_CPU(env);
-
return !runstate_is_running() || cpu->stopped;
}
diff --git a/include/qemu/cpu.h b/include/qemu/cpu.h
index 83378c5..4e62032 100644
--- a/include/qemu/cpu.h
+++ b/include/qemu/cpu.h
@@ -94,5 +94,16 @@ void cpu_reset(CPUState *cpu);
*/
bool qemu_cpu_is_self(CPUState *cpu);
+/**
+ * cpu_is_stopped:
+ * @cpu: The CPU to check.
+ *
+ * Checks whether the CPU is stopped.
+ *
+ * Returns: %true if run state is not running or if artificially stopped;
+ * %false otherwise.
+ */
+bool cpu_is_stopped(CPUState *cpu);
+
#endif
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index c13f196..a3491a4 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1555,7 +1555,7 @@ int kvm_arch_put_registers(CPUX86State *env, int level)
CPUState *cpu = ENV_GET_CPU(env);
int ret;
- assert(cpu_is_stopped(env) || qemu_cpu_is_self(cpu));
+ assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
ret = kvm_getput_regs(env, 1);
if (ret < 0) {
@@ -1613,7 +1613,7 @@ int kvm_arch_get_registers(CPUX86State *env)
CPUState *cpu = ENV_GET_CPU(env);
int ret;
- assert(cpu_is_stopped(env) || qemu_cpu_is_self(cpu));
+ assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
ret = kvm_getput_regs(env, 0);
if (ret < 0) {
--
1.7.10.4
- [Qemu-devel] [PULL] QOM CPUState patch queue 2012-10-31, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 04/35] target-i386: Inline APIC cpu_env property setting, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 01/35] target-i386: cpu_x86_register(): report error from property setter, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 02/35] target-i386: If x86_cpu_realize() failed, report error and do cleanup, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 03/35] target-i386: Initialize APIC at CPU level, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 09/35] cpu: Move created field to CPUState, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 08/35] cpus: Pass CPUState to qemu_cpu_kick_thread(), Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 13/35] cpus: Pass CPUState to cpu_is_stopped(),
Andreas Färber <=
- [Qemu-devel] [PATCH 06/35] target-i386: Pass X86CPU to cpu_x86_load_seg_cache_sipi(), Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 14/35] cpus: Pass CPUState to cpu_can_run(), Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 16/35] cpus: Pass CPUState to qemu_tcg_cpu_thread_fn, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 15/35] cpu: Move halt_cond to CPUState, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 07/35] cpus: Pass CPUState to qemu_cpu_is_self(), Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 11/35] ppce500_spin: Store PowerPCCPU in SpinKick, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 05/35] apic: Store X86CPU in APICCommonState, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 18/35] ppc: Pass PowerPCCPU to {ppc6xx, ppc970, power7, ppc40x, ppce500}_set_irq(), Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 10/35] cpu: Move stop field to CPUState, Andreas Färber, 2012/10/30
- [Qemu-devel] [PATCH 12/35] cpu: Move stopped field to CPUState, Andreas Färber, 2012/10/30