From patchwork Wed Aug 26 11:53:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 32129 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 E004BB6F34 for ; Wed, 26 Aug 2009 21:56:02 +1000 (EST) Received: from localhost ([127.0.0.1]:34401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgH6b-0002fX-CD for incoming@patchwork.ozlabs.org; Wed, 26 Aug 2009 07:55:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgH4b-0001q0-Br for qemu-devel@nongnu.org; Wed, 26 Aug 2009 07:53:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgH4W-0001mE-Oz for qemu-devel@nongnu.org; Wed, 26 Aug 2009 07:53:53 -0400 Received: from [199.232.76.173] (port=52125 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgH4W-0001m7-IX for qemu-devel@nongnu.org; Wed, 26 Aug 2009 07:53:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54824) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgH4V-00052d-Tp for qemu-devel@nongnu.org; Wed, 26 Aug 2009 07:53:48 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7QBrkVC001212 for ; Wed, 26 Aug 2009 07:53:46 -0400 Received: from zweiblum.home.kraxel.org (vpn1-4-183.ams2.redhat.com [10.36.4.183]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n7QBrgDB024467; Wed, 26 Aug 2009 07:53:43 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 4234C700E0; Wed, 26 Aug 2009 13:53:40 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 26 Aug 2009 13:53:31 +0200 Message-Id: <1251287619-20022-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1251287619-20022-1-git-send-email-kraxel@redhat.com> References: <1251287619-20022-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 03/11] ide: split away ide-isa.c 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 create ide-isa.c and place isa bus support there. only build ide-isa support for platforms using it. also create ide.h header file. Signed-off-by: Gerd Hoffmann --- Makefile.target | 7 ++++--- hw/ide-internal.h | 1 + hw/ide-isa.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ hw/ide.c | 14 -------------- hw/ide.h | 10 ++++++++++ hw/mips_r4k.c | 1 + hw/pc.c | 1 + hw/pc.h | 2 -- hw/ppc_prep.c | 1 + 9 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 hw/ide-isa.c create mode 100644 hw/ide.h diff --git a/Makefile.target b/Makefile.target index 690f30b..553bb9c 100644 --- a/Makefile.target +++ b/Makefile.target @@ -187,14 +187,14 @@ obj-y += e1000.o obj-y += wdt_ib700.o wdt_i6300esb.o # Hardware support -obj-i386-y = ide.o pckbd.o vga.o $(sound-obj-y) dma.o isa-bus.o +obj-i386-y = ide.o ide-isa.o pckbd.o vga.o $(sound-obj-y) dma.o isa-bus.o obj-i386-y += fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o obj-i386-y += cirrus_vga.o apic.o ioapic.o parallel.o acpi.o piix_pci.o obj-i386-y += usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o obj-i386-y += device-hotplug.o pci-hotplug.o smbios.o # shared objects -obj-ppc-y = ppc.o ide.o vga.o $(sound-obj-y) dma.o isa-bus.o openpic.o +obj-ppc-y = ppc.o ide.o ide-isa.o vga.o $(sound-obj-y) dma.o isa-bus.o openpic.o # PREP target obj-ppc-y += pckbd.o serial.o i8259.o i8254.o fdc.o mc146818rtc.o obj-ppc-y += prep_pci.o ppc_prep.o @@ -215,7 +215,8 @@ obj-ppc-$(CONFIG_FDT) += device_tree.o obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o obj-mips-y += mips_timer.o mips_int.o dma.o vga.o serial.o i8254.o i8259.o rc4030.o obj-mips-y += g364fb.o jazz_led.o dp8393x.o -obj-mips-y += ide.o gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o +obj-mips-y += ide.o ide-isa.o +obj-mips-y += gt64xxx.o pckbd.o fdc.o mc146818rtc.o usb-uhci.o acpi.o ds1225y.o obj-mips-y += piix_pci.o parallel.o cirrus_vga.o isa-bus.o pcspk.o $(sound-obj-y) obj-mips-y += mipsnet.o obj-mips-y += pflash_cfi01.o diff --git a/hw/ide-internal.h b/hw/ide-internal.h index 5cade96..bb65861 100644 --- a/hw/ide-internal.h +++ b/hw/ide-internal.h @@ -6,6 +6,7 @@ * only hw/ide*.c is supposed to include this file. * non-internal declarations are in hw/ide.h */ +#include "ide.h" /* debug IDE devices */ //#define DEBUG_IDE diff --git a/hw/ide-isa.c b/hw/ide-isa.c new file mode 100644 index 0000000..705c24d --- /dev/null +++ b/hw/ide-isa.c @@ -0,0 +1,45 @@ +/* + * QEMU IDE Emulation: ISA Bus support. + * + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2006 Openedhand Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include "hw.h" +#include "pc.h" +#include "block.h" +#include "block_int.h" +#include "sysemu.h" +#include "dma.h" +#include "ide-internal.h" + +/***********************************************************/ +/* ISA IDE definitions */ + +void isa_ide_init(int iobase, int iobase2, qemu_irq irq, + BlockDriverState *hd0, BlockDriverState *hd1) +{ + IDEBus *bus; + + bus = qemu_mallocz(sizeof(*bus)); + + ide_init2(bus, hd0, hd1, irq); + ide_init_ioport(bus, iobase, iobase2); +} diff --git a/hw/ide.c b/hw/ide.c index 0a112a4..196b2fb 100644 --- a/hw/ide.c +++ b/hw/ide.c @@ -2674,20 +2674,6 @@ void idebus_load(QEMUFile* f, IDEBus *bus, int version_id) } /***********************************************************/ -/* ISA IDE definitions */ - -void isa_ide_init(int iobase, int iobase2, qemu_irq irq, - BlockDriverState *hd0, BlockDriverState *hd1) -{ - IDEBus *bus; - - bus = qemu_mallocz(sizeof(*bus)); - - ide_init2(bus, hd0, hd1, irq); - ide_init_ioport(bus, iobase, iobase2); -} - -/***********************************************************/ /* PCI IDE definitions */ static void cmd646_update_irq(PCIIDEState *d); diff --git a/hw/ide.h b/hw/ide.h new file mode 100644 index 0000000..73ef93e --- /dev/null +++ b/hw/ide.h @@ -0,0 +1,10 @@ +#ifndef HW_IDE_H +#define HW_IDE_H + +#include "qdev.h" + +/* ide-isa.c */ +void isa_ide_init(int iobase, int iobase2, qemu_irq irq, + BlockDriverState *hd0, BlockDriverState *hd1); + +#endif /* HW_IDE_H */ diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c index d902591..24c1884 100644 --- a/hw/mips_r4k.c +++ b/hw/mips_r4k.c @@ -17,6 +17,7 @@ #include "flash.h" #include "qemu-log.h" #include "mips-bios.h" +#include "ide.h" #define PHYS_TO_VIRT(x) ((x) | ~(target_ulong)0x7fffffff) diff --git a/hw/pc.c b/hw/pc.c index 11b8618..1bf78c6 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -36,6 +36,7 @@ #include "hpet_emul.h" #include "watchdog.h" #include "smbios.h" +#include "ide.h" /* output Bochs bios info messages */ //#define DEBUG_BIOS diff --git a/hw/pc.h b/hw/pc.h index 5649fc4..5bdaadf 100644 --- a/hw/pc.h +++ b/hw/pc.h @@ -144,8 +144,6 @@ void pci_cirrus_vga_init(PCIBus *bus); void isa_cirrus_vga_init(void); /* ide.c */ -void isa_ide_init(int iobase, int iobase2, qemu_irq irq, - BlockDriverState *hd0, BlockDriverState *hd1); void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table, int secondary_ide_enabled); void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn, diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c index 223ca61..42d1af5 100644 --- a/hw/ppc_prep.c +++ b/hw/ppc_prep.c @@ -32,6 +32,7 @@ #include "ppc.h" #include "boards.h" #include "qemu-log.h" +#include "ide.h" //#define HARD_DEBUG_PPC_IO //#define DEBUG_PPC_IO