From patchwork Thu Dec 24 08:09:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 41741 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 0895BB7BF5 for ; Thu, 24 Dec 2009 19:15:44 +1100 (EST) Received: from localhost ([127.0.0.1]:44948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNirF-0003QM-D7 for incoming@patchwork.ozlabs.org; Thu, 24 Dec 2009 03:15:41 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNilN-00021b-M0 for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNilG-0001wD-2X for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:33 -0500 Received: from [199.232.76.173] (port=42921 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNilE-0001vG-8m for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:28 -0500 Received: from mail.valinux.co.jp ([210.128.90.3]:39718) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNilD-0004Uh-Uu for qemu-devel@nongnu.org; Thu, 24 Dec 2009 03:09:28 -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 D91E5106AB8; Thu, 24 Dec 2009 17:09:21 +0900 (JST) Received: (nullmailer pid 22807 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:05 +0900 Message-Id: <1261642160-22754-13-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 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 --- 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 2eab237..0929b50 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) { @@ -1132,7 +1138,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);