From patchwork Thu May 2 13:35:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 240985 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 47CB12C00A1 for ; Thu, 2 May 2013 23:41:42 +1000 (EST) Received: from localhost ([::1]:50255 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtlU-0001jx-Ga for incoming@patchwork.ozlabs.org; Thu, 02 May 2013 09:41:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtgB-00030E-FK for qemu-devel@nongnu.org; Thu, 02 May 2013 09:36:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXtg3-0004VH-4E for qemu-devel@nongnu.org; Thu, 02 May 2013 09:36:11 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46589 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtg2-0004Ub-R2 for qemu-devel@nongnu.org; Thu, 02 May 2013 09:36:03 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B9148A5559; Thu, 2 May 2013 15:36:00 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Thu, 2 May 2013 15:35:29 +0200 Message-Id: <1367501755-32272-4-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1367501755-32272-1-git-send-email-afaerber@suse.de> References: <1367501755-32272-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Igor Mammedov , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 03/29] cpu: Introduce cpu_resume(), for single CPU 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 From: Igor Mammedov Also add a stub for it, to make possible to use it in qom/cpu.c, which is shared with user emulators. Signed-off-by: Igor Mammedov Signed-off-by: Andreas Färber --- cpus.c | 11 ++++++++--- include/qom/cpu.h | 7 +++++++ stubs/Makefile.objs | 1 + stubs/cpus.c | 5 +++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 stubs/cpus.c diff --git a/cpus.c b/cpus.c index 5a98a37..1d88761 100644 --- a/cpus.c +++ b/cpus.c @@ -993,6 +993,13 @@ void pause_all_vcpus(void) } } +void cpu_resume(CPUState *cpu) +{ + cpu->stop = false; + cpu->stopped = false; + qemu_cpu_kick(cpu); +} + void resume_all_vcpus(void) { CPUArchState *penv = first_cpu; @@ -1000,9 +1007,7 @@ void resume_all_vcpus(void) qemu_clock_enable(vm_clock, true); while (penv) { CPUState *pcpu = ENV_GET_CPU(penv); - pcpu->stop = false; - pcpu->stopped = false; - qemu_cpu_kick(pcpu); + cpu_resume(pcpu); penv = penv->next_cpu; } } diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 3664a1b..ac93dce 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -256,5 +256,12 @@ void cpu_interrupt(CPUState *cpu, int mask); */ void cpu_reset_interrupt(CPUState *cpu, int mask); +/** + * cpu_resume: + * @cpu: The CPU to resume. + * + * Resumes CPU, i.e. puts CPU into runnable state. + */ +void cpu_resume(CPUState *cpu); #endif diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 9c55b34..03dff20 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -23,3 +23,4 @@ stub-obj-y += sysbus.o stub-obj-y += vm-stop.o stub-obj-y += vmstate.o stub-obj-$(CONFIG_WIN32) += fd-register.o +stub-obj-y += cpus.o diff --git a/stubs/cpus.c b/stubs/cpus.c new file mode 100644 index 0000000..37000dd --- /dev/null +++ b/stubs/cpus.c @@ -0,0 +1,5 @@ +#include "qom/cpu.h" + +void cpu_resume(CPUState *cpu) +{ +}