From patchwork Fri Aug 14 09:36:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 31383 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 bilbo.ozlabs.org (Postfix) with ESMTPS id ADDDBB7067 for ; Fri, 14 Aug 2009 19:37:20 +1000 (EST) Received: from localhost ([127.0.0.1]:33782 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbtDl-0003wB-9V for incoming@patchwork.ozlabs.org; Fri, 14 Aug 2009 05:37:13 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MbtD2-0003vz-1B for qemu-devel@nongnu.org; Fri, 14 Aug 2009 05:36:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MbtCx-0003vW-Bh for qemu-devel@nongnu.org; Fri, 14 Aug 2009 05:36:27 -0400 Received: from [199.232.76.173] (port=49165 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MbtCx-0003vT-5A for qemu-devel@nongnu.org; Fri, 14 Aug 2009 05:36:23 -0400 Received: from mx2.redhat.com ([66.187.237.31]:37450) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MbtCw-00041e-Lh for qemu-devel@nongnu.org; Fri, 14 Aug 2009 05:36:22 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7E9aM3t013095 for ; Fri, 14 Aug 2009 05:36:22 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7E9aLSA008824; Fri, 14 Aug 2009 05:36:21 -0400 Received: from zweiblum.home.kraxel.org (vpn1-4-95.ams2.redhat.com [10.36.4.95]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with SMTP id n7E9aIk2011209; Fri, 14 Aug 2009 05:36:19 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 390D3700D7; Fri, 14 Aug 2009 11:36:16 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 14 Aug 2009 11:36:16 +0200 Message-Id: <1250242576-25494-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1250242576-25494-1-git-send-email-kraxel@redhat.com> References: <1250242576-25494-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 3/3] Move isa_connect_irq calls into isa_create_simple 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 Now with isa-bus maintaining the isa irqs we can move the isa_connect_irq() calls into isa_create_simple(). Signed-off-by: Gerd Hoffmann --- hw/fdc.c | 3 +-- hw/isa-bus.c | 7 ++++++- hw/isa.h | 3 ++- hw/pc.c | 4 +--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index 4011cc3..b23b518 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -1878,9 +1878,8 @@ fdctrl_t *fdctrl_init_isa(int isairq, int dma_chann, fdctrl_t *fdctrl; ISADevice *dev; - dev = isa_create_simple("isa-fdc", io_base, 0); + dev = isa_create_simple("isa-fdc", io_base, 0, isairq, -1); fdctrl = &(DO_UPCAST(fdctrl_isabus_t, busdev, dev)->state); - isa_connect_irq(dev, 0, isairq); fdctrl->dma_chann = dma_chann; DMA_register_channel(dma_chann, &fdctrl_transfer_handler, fdctrl); diff --git a/hw/isa-bus.c b/hw/isa-bus.c index 6eb2891..af0791e 100644 --- a/hw/isa-bus.c +++ b/hw/isa-bus.c @@ -130,7 +130,8 @@ void isa_qdev_register(ISADeviceInfo *info) qdev_register(&info->qdev); } -ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2) +ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2, + uint32_t irq, uint32 irq2) { DeviceState *dev; ISADevice *isa; @@ -144,6 +145,10 @@ ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2 isa->iobase[0] = iobase; isa->iobase[1] = iobase2; qdev_init(dev); + if (-1 != irq) + isa_connect_irq(isa, 0, irq); + if (-1 != irq2) + isa_connect_irq(isa, 1, irq2); return isa; } diff --git a/hw/isa.h b/hw/isa.h index 31853a0..872e3ef 100644 --- a/hw/isa.h +++ b/hw/isa.h @@ -30,7 +30,8 @@ void isa_connect_irq(ISADevice *dev, int devirq, int isairq); qemu_irq isa_reserve_irq(int isairq); void isa_init_irq(ISADevice *dev, qemu_irq *p); void isa_qdev_register(ISADeviceInfo *info); -ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2); +ISADevice *isa_create_simple(const char *name, uint32_t iobase, uint32_t iobase2, + uint32_t irq, uint32_t irq2); extern target_phys_addr_t isa_mem_base; diff --git a/hw/pc.c b/hw/pc.c index a48f820..820aa3e 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1367,9 +1367,7 @@ static void pc_init1(ram_addr_t ram_size, } } - isa_dev = isa_create_simple("i8042", 0x60, 0x64); - isa_connect_irq(isa_dev, 0, 1); - isa_connect_irq(isa_dev, 1, 12); + isa_dev = isa_create_simple("i8042", 0x60, 0x64, 1, 12); DMA_init(0); #ifdef HAS_AUDIO audio_init(pci_enabled ? pci_bus : NULL, i8259);