Received: from eggs.gnu.org ([2001:4830:134:3::10]:55800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Uuz-0008SM-To for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:47:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Uuu-0000NT-SP for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:47:49 -0400 Received: from greensocs.com ([193.104.36.180]:39909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Uuu-0000Mg-Lv for qemu-devel@nongnu.org; Fri, 26 Jun 2015 10:47:44 -0400 From: fred.konrad@greensocs.com Date: Fri, 26 Jun 2015 16:47:16 +0200 Message-Id: <1435330053-18733-2-git-send-email-fred.konrad@greensocs.com> In-Reply-To: <1435330053-18733-1-git-send-email-fred.konrad@greensocs.com> References: <1435330053-18733-1-git-send-email-fred.konrad@greensocs.com> Subject: [Qemu-devel] [RFC PATCH V6 01/18] cpu: make cpu_thread_is_idle public. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, mttcg@listserver.greensocs.com Cc: peter.maydell@linaro.org, a.spyridakis@virtualopensystems.com, mark.burton@greensocs.com, agraf@suse.de, alistair.francis@xilinx.com, guillaume.delbergue@greensocs.com, pbonzini@redhat.com, alex.bennee@linaro.org, fred.konrad@greensocs.com From: KONRAD Frederic Signed-off-by: KONRAD Frederic --- cpus.c | 2 +- include/qom/cpu.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index 4f0e54d..2d62a35 100644 --- a/cpus.c +++ b/cpus.c @@ -74,7 +74,7 @@ bool cpu_is_stopped(CPUState *cpu) return cpu->stopped || !runstate_is_running(); } -static bool cpu_thread_is_idle(CPUState *cpu) +bool cpu_thread_is_idle(CPUState *cpu) { if (cpu->stop || cpu->queued_work_first) { return false; diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 39f0f19..af3c9e4 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -514,6 +514,17 @@ void qemu_cpu_kick(CPUState *cpu); bool cpu_is_stopped(CPUState *cpu); /** + * cpu_thread_is_idle: + * @cpu: The CPU to check. + * + * Checks whether the CPU thread is idle. + * + * Returns: %true if the thread is idle; + * %false otherwise. + */ +bool cpu_thread_is_idle(CPUState *cpu); + +/** * run_on_cpu: * @cpu: The vCPU to run on. * @func: The function to be executed. -- 1.9.0