From patchwork Wed Jan 6 02:39: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: 42257 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 26544B6EEF for ; Wed, 6 Jan 2010 13:59:55 +1100 (EST) Received: from localhost ([127.0.0.1]:42885 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSM7k-0003y9-D7 for incoming@patchwork.ozlabs.org; Tue, 05 Jan 2010 21:59:52 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NSLof-0004Pd-NP for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:40:10 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NSLoX-0004Jr-4s for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:40:07 -0500 Received: from [199.232.76.173] (port=54795 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NSLoU-0004Io-H8 for qemu-devel@nongnu.org; Tue, 05 Jan 2010 21:39:58 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:60929) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NSLoT-0003kb-1y 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 CF8A1182A2; Wed, 6 Jan 2010 11:39:45 +0900 (JST) Received: (nullmailer pid 28750 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:36 +0900 Message-Id: <1262745591-28697-13-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 12/27] pc: make pc_init1() not refer ferr_irq directly. 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 By introducing a registering function, make pc_init1() not refer to ferr_irq directly in order to make ferr_irq piix independent. Later pc_init1() will be split out into another file keeping ferr_irq static. Signed-off-by: Isaku Yamahata Acked-by: Gerd Hoffmann --- hw/pc.c | 8 +++++++- hw/pc.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index fc603bc..1a13b0f 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -86,6 +86,12 @@ static void ioport80_write(void *opaque, uint32_t addr, uint32_t data) /* MSDOS compatibility mode FPU exception support */ static qemu_irq ferr_irq; + +void pc_register_ferr_irq(qemu_irq irq) +{ + ferr_irq = irq; +} + /* XXX: add IGNNE support */ void cpu_set_ferr(CPUX86State *s) { @@ -1141,7 +1147,7 @@ static void pc_init1(ram_addr_t ram_size, } isa_bus_irqs(isa_irq); - ferr_irq = isa_reserve_irq(13); + pc_register_ferr_irq(isa_reserve_irq(13)); /* init basic PC hardware */ register_ioport_write(0x80, 1, 1, ioport80_write, NULL); diff --git a/hw/pc.h b/hw/pc.h index 4ad20c1..6791b0b 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -91,6 +91,8 @@ void cmos_set_s3_resume_fn(void *opaque, int n, int level); /* pc.c */ extern int fd_bootchk; +void pc_register_ferr_irq(qemu_irq irq); + void ioport_set_a20(int enable); int ioport_get_a20(void);