From patchwork Tue Dec 8 08:33:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 40599 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6DE28B7BBC for ; Tue, 8 Dec 2009 20:05:56 +1100 (EST) Received: from localhost ([127.0.0.1]:37625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHw13-0007zZ-5J for incoming@patchwork.ozlabs.org; Tue, 08 Dec 2009 04:05:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHvWX-0004tv-1s for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHvWH-0004hB-BL for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:10 -0500 Received: from [199.232.76.173] (port=47186 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHvWG-0004gj-I2 for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:04 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:60095) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHvWE-0002xH-QG for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:03 -0500 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id EC93D4A488; Tue, 8 Dec 2009 17:33:55 +0900 (JST) Received: (nullmailer pid 16159 invoked by uid 1000); Tue, 08 Dec 2009 08:33:39 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Tue, 8 Dec 2009 17:33:32 +0900 Message-Id: <1260261219-16103-14-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1260261219-16103-1-git-send-email-yamahata@valinux.co.jp> References: <1260261219-16103-1-git-send-email-yamahata@valinux.co.jp> X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH V9 13/20] pc: split out cpu initialization from pc_init1() into pc_cpus_init(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org split out cpu initialization which is piix independent from pc_init1() into pc_cpus_init(). Later it will be used. Signed-off-by: Isaku Yamahata --- hw/pc.c | 32 +++++++++++++++++++------------- 1 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index d0ef06b..6c5fc9d 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -982,6 +982,24 @@ static CPUState *pc_new_cpu(const char *cpu_model) return env; } +static void pc_cpus_init(const char *cpu_model) +{ + int i; + + /* init CPUs */ + if (cpu_model == NULL) { +#ifdef TARGET_X86_64 + cpu_model = "qemu64"; +#else + cpu_model = "qemu32"; +#endif + } + + for(i = 0; i < smp_cpus; i++) { + (void)pc_new_cpu(cpu_model); + } +} + static qemu_irq *pc_allocate_cpu_irq(void) { return qemu_allocate_irqs(pic_irq_request, NULL, 1); @@ -1005,7 +1023,6 @@ static void pc_init1(ram_addr_t ram_size, ISADevice *isa_dev; PCII440FXState *i440fx_state; int piix3_devfn = -1; - CPUState *env; qemu_irq *cpu_irq; qemu_irq *isa_irq; qemu_irq *i8259; @@ -1026,18 +1043,7 @@ static void pc_init1(ram_addr_t ram_size, linux_boot = (kernel_filename != NULL); - /* init CPUs */ - if (cpu_model == NULL) { -#ifdef TARGET_X86_64 - cpu_model = "qemu64"; -#else - cpu_model = "qemu32"; -#endif - } - - for (i = 0; i < smp_cpus; i++) { - env = pc_new_cpu(cpu_model); - } + pc_cpus_init(cpu_model); vmport_init();