mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
cpus.c: Make all_cpu_threads_idle() static
Commit 946fb27c1
moved all the uses of all_cpu_threads_idle()
into cpus.c. This means we can mark the function 'static'
(again), if we shuffle it a bit earlier in the source file.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
parent
7c7bb0223e
commit
ac873f1ed5
2 changed files with 26 additions and 27 deletions
52
cpus.c
52
cpus.c
|
@ -61,6 +61,32 @@
|
|||
|
||||
static CPUArchState *next_cpu;
|
||||
|
||||
static bool cpu_thread_is_idle(CPUArchState *env)
|
||||
{
|
||||
if (env->stop || env->queued_work_first) {
|
||||
return false;
|
||||
}
|
||||
if (env->stopped || !runstate_is_running()) {
|
||||
return true;
|
||||
}
|
||||
if (!env->halted || qemu_cpu_has_work(env) || kvm_irqchip_in_kernel()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool all_cpu_threads_idle(void)
|
||||
{
|
||||
CPUArchState *env;
|
||||
|
||||
for (env = first_cpu; env != NULL; env = env->next_cpu) {
|
||||
if (!cpu_thread_is_idle(env)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/***********************************************************/
|
||||
/* guest cycle counter */
|
||||
|
||||
|
@ -433,32 +459,6 @@ static int cpu_can_run(CPUArchState *env)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static bool cpu_thread_is_idle(CPUArchState *env)
|
||||
{
|
||||
if (env->stop || env->queued_work_first) {
|
||||
return false;
|
||||
}
|
||||
if (env->stopped || !runstate_is_running()) {
|
||||
return true;
|
||||
}
|
||||
if (!env->halted || qemu_cpu_has_work(env) || kvm_irqchip_in_kernel()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool all_cpu_threads_idle(void)
|
||||
{
|
||||
CPUArchState *env;
|
||||
|
||||
for (env = first_cpu; env != NULL; env = env->next_cpu) {
|
||||
if (!cpu_thread_is_idle(env)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void cpu_handle_guest_debug(CPUArchState *env)
|
||||
{
|
||||
gdb_set_stop_cpu(env);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue