[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/39] Un-inline fdctrl_init_isa()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 08/39] Un-inline fdctrl_init_isa() |
Date: |
Fri, 15 Jun 2012 15:33:08 +0200 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Anthony Liguori <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/fdc.c | 20 ++++++++++++++++++++
hw/fdc.h | 24 ++----------------------
hw/ide/piix.c | 3 ++-
hw/isa.h | 2 --
hw/pc_sysfw.c | 1 +
qemu-common.h | 1 +
6 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/hw/fdc.c b/hw/fdc.c
index 30d34e3..bfa4e68 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -1888,6 +1888,26 @@ static int fdctrl_connect_drives(FDCtrl *fdctrl)
return 0;
}
+ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds)
+{
+ ISADevice *dev;
+
+ dev = isa_try_create(bus, "isa-fdc");
+ if (!dev) {
+ return NULL;
+ }
+
+ if (fds[0]) {
+ qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv);
+ }
+ if (fds[1]) {
+ qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv);
+ }
+ qdev_init_nofail(&dev->qdev);
+
+ return dev;
+}
+
void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
target_phys_addr_t mmio_base, DriveInfo **fds)
{
diff --git a/hw/fdc.h b/hw/fdc.h
index 55a8d73..1b32b17 100644
--- a/hw/fdc.h
+++ b/hw/fdc.h
@@ -1,32 +1,12 @@
#ifndef HW_FDC_H
#define HW_FDC_H
-#include "isa.h"
-#include "blockdev.h"
+#include "qemu-common.h"
/* fdc.c */
#define MAX_FD 2
-static inline ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds)
-{
- ISADevice *dev;
-
- dev = isa_try_create(bus, "isa-fdc");
- if (!dev) {
- return NULL;
- }
-
- if (fds[0]) {
- qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv);
- }
- if (fds[1]) {
- qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv);
- }
- qdev_init_nofail(&dev->qdev);
-
- return dev;
-}
-
+ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds);
void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
target_phys_addr_t mmio_base, DriveInfo **fds);
void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index bcaa400..f5a74c2 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -22,11 +22,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+
#include <hw/hw.h>
#include <hw/pc.h>
#include <hw/pci.h>
#include <hw/isa.h>
-#include "block.h"
+#include "blockdev.h"
#include "sysemu.h"
#include "dma.h"
diff --git a/hw/isa.h b/hw/isa.h
index f7bc4b5..6c6fd7f 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -9,8 +9,6 @@
#define ISA_NUM_IRQS 16
-typedef struct ISADevice ISADevice;
-
#define TYPE_ISA_DEVICE "isa-device"
#define ISA_DEVICE(obj) \
OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE)
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index f0d7c21..b45f0ac 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -23,6 +23,7 @@
* THE SOFTWARE.
*/
+#include "blockdev.h"
#include "sysbus.h"
#include "hw.h"
#include "pc.h"
diff --git a/qemu-common.h b/qemu-common.h
index 91e0562..8f87e41 100644
--- a/qemu-common.h
+++ b/qemu-common.h
@@ -239,6 +239,7 @@ typedef struct VLANState VLANState;
typedef struct VLANClientState VLANClientState;
typedef struct i2c_bus i2c_bus;
typedef struct ISABus ISABus;
+typedef struct ISADevice ISADevice;
typedef struct SMBusDevice SMBusDevice;
typedef struct PCIHostState PCIHostState;
typedef struct PCIExpressHost PCIExpressHost;
--
1.7.6.5
- [Qemu-devel] [PULL 00/39] Block patches, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 02/39] qcow2: fix endianness conversion, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 03/39] block: implement is_allocated for raw, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 08/39] Un-inline fdctrl_init_isa(),
Kevin Wolf <=
- [Qemu-devel] [PATCH 05/39] stream: move is_allocated_above to block.c, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 09/39] qemu-img check -r for repairing images, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 06/39] stream: move rate limiting to a separate header file, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 01/39] qcow2: remove a line of unnecessary code, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 07/39] xtensa_lx60: add missing #include "blockdev.h", Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 04/39] stream: tweak usage of bdrv_co_is_allocated, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 12/39] rbd: hook up cache options, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 11/39] qcow2: Support for fixing refcount inconsistencies, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 13/39] sheepdog: add coroutine_fn markers to coroutine functions, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 14/39] block: Simplify how drive_init() computes default ID, Kevin Wolf, 2012/06/15