aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-08-20 15:22:19 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:43:33 -0500
commitec82026c97975e1e327aab76653ff7edeeb27967 (patch)
tree7909faa1a5e5bd503dc44e25ca30f835a5d8e721 /hw
parent356721aede69c80141c4a94ec26a78f91d63c9a5 (diff)
downloadqemu-ec82026c97975e1e327aab76653ff7edeeb27967.zip
qemu-ec82026c97975e1e327aab76653ff7edeeb27967.tar.gz
qemu-ec82026c97975e1e327aab76653ff7edeeb27967.tar.bz2
ide: split away ide-isa.c
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/ide-internal.h1
-rw-r--r--hw/ide-isa.c45
-rw-r--r--hw/ide.c14
-rw-r--r--hw/ide.h10
-rw-r--r--hw/mips_r4k.c1
-rw-r--r--hw/pc.c1
-rw-r--r--hw/pc.h2
-rw-r--r--hw/ppc_prep.c1
8 files changed, 59 insertions, 16 deletions
diff --git a/hw/ide-internal.h b/hw/ide-internal.h
index 7fb8252..4f3f86c 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 654d78b..ab3248e 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -2673,20 +2673,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 59f4fbc..77ad8a1 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 7665cb7..1cad17f 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