From patchwork Wed Jan 6 02:39:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 42252 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 434F9B6EEF for ; Wed, 6 Jan 2010 13:49:38 +1100 (EST) Received: from localhost ([127.0.0.1]:56414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSLxn-0006vU-FQ for incoming@patchwork.ozlabs.org; Tue, 05 Jan 2010 21:49:35 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSLod-0004OI-VH for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:40:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSLoY-0004JR-Mq for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:40:04 -0500 Received: from [199.232.76.173] (port=54796 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSLoV-0004JF-7O for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:39:59 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:60927) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSLoT-0003kX-93 for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:39:58 -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 8A1BF182A6; Wed, 6 Jan 2010 11:39:46 +0900 (JST) Received: (nullmailer pid 28748 invoked by uid 1000); Wed, 06 Jan 2010 02:39:51 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kraxel@redhat.com, aurelien@aurel32.net Date: Wed, 6 Jan 2010 11:39:35 +0900 Message-Id: <1262745591-28697-12-git-send-email-yamahata@valinux.co.jp> X-Mailer: git-send-email 1.6.5.4 In-Reply-To: <1262745591-28697-1-git-send-email-yamahata@valinux.co.jp> References: <1262745591-28697-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 V12 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 Acked-by: Gerd Hoffmann --- hw/pc.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 3ad9bbb..fc603bc 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -987,6 +987,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, @@ -1119,7 +1124,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;