From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCPTd-0006qp-Ne for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:47:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZCPTa-0002C1-6E for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:47:45 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:33595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZCPTZ-0002Bf-Vc for qemu-devel@nongnu.org; Tue, 07 Jul 2015 05:47:42 -0400 Received: by wiwl6 with SMTP id l6so308983471wiw.0 for ; Tue, 07 Jul 2015 02:47:40 -0700 (PDT) References: <1435330053-18733-1-git-send-email-fred.konrad@greensocs.com> <1435330053-18733-2-git-send-email-fred.konrad@greensocs.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1435330053-18733-2-git-send-email-fred.konrad@greensocs.com> Date: Tue, 07 Jul 2015 10:47:36 +0100 Message-ID: <87si909u4n.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [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: fred.konrad@greensocs.com Cc: mttcg@listserver.greensocs.com, peter.maydell@linaro.org, a.spyridakis@virtualopensystems.com, mark.burton@greensocs.com, agraf@suse.de, qemu-devel@nongnu.org, guillaume.delbergue@greensocs.com, pbonzini@redhat.com, alistair.francis@xilinx.com fred.konrad@greensocs.com writes: > From: KONRAD Frederic Why are we making this visible? Looking at the tree I can't see it being used outside the cpus.c. I see the function is modified later for async work. Is this something we are planing to use later? > > 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. -- Alex Bennée