From patchwork Thu Dec 24 08:09:04 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 41742 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 8A960B7BF5 for ; Thu, 24 Dec 2009 19:23:58 +1100 (EST) Received: from localhost ([127.0.0.1]:44339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNizB-0006HY-PH for incoming@patchwork.ozlabs.org; Thu, 24 Dec 2009 03:23:54 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNilO-00022K-2d for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNilG-0001x2-8j for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:34 -0500 Received: from [199.232.76.173] (port=42923 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNilF-0001w5-Ci for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:29 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:39727) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNilF-0004Vb-0w for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:29 -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 8A8CC106ABB; Thu, 24 Dec 2009 17:09:22 +0900 (JST) Received: (nullmailer pid 22805 invoked by uid 1000); Thu, 24 Dec 2009 08:09:20 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kraxel@redhat.com Date: Thu, 24 Dec 2009 17:09:04 +0900 Message-Id: <1261642160-22754-12-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1261642160-22754-1-git-send-email-yamahata@valinux.co.jp> References: <1261642160-22754-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 V10 11/27] 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 45d7fad..2eab237 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -978,6 +978,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, @@ -1110,7 +1115,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;