From patchwork Tue Dec 8 08:33:30 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 40595 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 29972B7BC0 for ; Tue, 8 Dec 2009 19:57:16 +1100 (EST) Received: from localhost ([127.0.0.1]:33294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHvsf-0003Hx-FC for incoming@patchwork.ozlabs.org; Tue, 08 Dec 2009 03:57:13 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHvWS-0004q1-Dx for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:16 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHvWH-0004go-Df for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:10 -0500 Received: from [199.232.76.173] (port=47183 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHvWF-0004fo-Nl for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:03 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:60093) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHvWD-0002x7-Rt for qemu-devel@nongnu.org; Tue, 08 Dec 2009 03:34:02 -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 35A394A47F; Tue, 8 Dec 2009 17:33:54 +0900 (JST) Received: (nullmailer pid 16155 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:30 +0900 Message-Id: <1260261219-16103-12-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 11/20] pc: introduce a function to allocate cpu irq. 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 Introduce a function, pc_allocate_cpu_irq(), to allocate cpu irq in order to make pic_irq_request() piix independent. Later piix code will be split out to another file keeping pic_irq_request() static. Signed-off-by: Isaku Yamahata --- hw/pc.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index ffe4b9c..5852d0e 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -976,6 +976,11 @@ static CPUState *pc_new_cpu(const char *cpu_model) return env; } +static qemu_irq *pc_allocate_cpu_irq(void) +{ + return qemu_allocate_irqs(pic_irq_request, NULL, 1); +} + /* PC hardware initialisation */ static void pc_init1(ram_addr_t ram_size, const char *boot_device, @@ -1108,7 +1113,7 @@ static void pc_init1(ram_addr_t ram_size, rom_add_option(option_rom[i]); } - cpu_irq = qemu_allocate_irqs(pic_irq_request, NULL, 1); + cpu_irq = pc_allocate_cpu_irq(); i8259 = i8259_init(cpu_irq[0]); isa_irq_state = qemu_mallocz(sizeof(*isa_irq_state)); isa_irq_state->i8259 = i8259;