From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 03/10] ide: split away ide-isa.c
Date: Thu, 20 Aug 2009 15:22:19 +0200 [thread overview]
Message-ID: <1250774546-18951-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1250774546-18951-1-git-send-email-kraxel@redhat.com>
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 <kraxel@redhat.com>
---
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 3f5d24a..f4d12c6 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -183,14 +183,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
@@ -211,7 +211,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 8cc58d0..1e36b3a 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 cd48b3d..9817968 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -2498,20 +2498,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 476612c..9e31501 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 cc6e7e8..817b922 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 9fbae20..a8b593f 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -152,8 +152,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 97190a2..6fd176f 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
--
1.6.2.5
next prev parent reply other threads:[~2009-08-20 13:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-20 13:22 [Qemu-devel] [PATCH 0/10] ide: cleanup and splitting Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 01/10] ide: add IDEBus struct, cleanups Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 02/10] ide: split away ide-internal.h Gerd Hoffmann
2009-08-20 23:40 ` Natalia Portillo
2009-08-21 7:21 ` Gerd Hoffmann
2009-08-20 13:22 ` Gerd Hoffmann [this message]
2009-08-20 13:22 ` [Qemu-devel] [PATCH 04/10] ide: split away ide-pci.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 05/10] ide: split away ide-macio.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 06/10] ide: split away ide-mmio.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 07/10] ide: split away ide-microdrive.c Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 08/10] ide: add save/restore support for isa Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 09/10] ide: add save/restore support for mmio Gerd Hoffmann
2009-08-20 13:22 ` [Qemu-devel] [PATCH 10/10] ide: move code to hw/ide/ Gerd Hoffmann
2009-08-20 16:39 ` [Qemu-devel] Re: [PATCH 0/10] ide: cleanup and splitting Juan Quintela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1250774546-18951-4-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).