From patchwork Tue Jan 5 06:27:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 42170 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 6F58FB6EF0 for ; Wed, 6 Jan 2010 07:01:42 +1100 (EST) Received: from localhost ([127.0.0.1]:46765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSFb1-0004oR-O4 for incoming@patchwork.ozlabs.org; Tue, 05 Jan 2010 15:01:39 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSF5L-00076L-HA for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:28:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSF5H-000728-It for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:28:55 -0500 Received: from [199.232.76.173] (port=34048 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSF5H-00071v-Ea for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:28:51 -0500 Received: from mx20.gnu.org ([199.232.41.8]:35457) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NSF5H-0002qi-3f for qemu-devel@nongnu.org; Tue, 05 Jan 2010 14:28:51 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NS8pX-0003ON-G8 for qemu-devel@nongnu.org; Tue, 05 Jan 2010 07:48:11 -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 2B0CC18299; Tue, 5 Jan 2010 15:27:46 +0900 (JST) Received: (nullmailer pid 22670 invoked by uid 1000); Tue, 05 Jan 2010 06:27:50 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Tue, 5 Jan 2010 15:27:36 +0900 Message-Id: <1262672870-22607-14-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1262672870-22607-1-git-send-email-yamahata@valinux.co.jp> References: <1262672870-22607-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 mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: yamahata@valinux.co.jp Subject: [Qemu-devel] [PATCH V11 13/27] 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 1a13b0f..90cf0f4 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -993,6 +993,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); @@ -1016,7 +1034,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; @@ -1037,18 +1054,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();