From patchwork Thu Jul 19 15:52:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 171966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 367DD2C00EB for ; Fri, 20 Jul 2012 01:52:49 +1000 (EST) Received: from localhost ([::1]:46481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srt1z-0000Qi-D6 for incoming@patchwork.ozlabs.org; Thu, 19 Jul 2012 11:52:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srt1t-0000Qc-AE for qemu-devel@nongnu.org; Thu, 19 Jul 2012 11:52:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Srt1o-0006v4-Pw for qemu-devel@nongnu.org; Thu, 19 Jul 2012 11:52:41 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:58786) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srt1o-0006uo-ID; Thu, 19 Jul 2012 11:52:36 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Srt1f-0003q0-3u; Thu, 19 Jul 2012 16:52:27 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 19 Jul 2012 16:52:27 +0100 Message-Id: <1342713147-14729-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: qemu-trivial@nongnu.org, Paolo Bonzini , patches@linaro.org Subject: [Qemu-devel] [PATCH] cpus.c: Make all_cpu_threads_idle() static X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- cpus.c | 52 ++++++++++++++++++++++++++-------------------------- qemu-common.h | 1 - 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/cpus.c b/cpus.c index b182b3d..756e624 100644 --- a/cpus.c +++ b/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); diff --git a/qemu-common.h b/qemu-common.h index 09676f5..7c8dac8 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -293,7 +293,6 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id); void qemu_cpu_kick(void *env); void qemu_cpu_kick_self(void); int qemu_cpu_is_self(void *env); -bool all_cpu_threads_idle(void); /* work queue */ struct qemu_work_item {