aboutsummaryrefslogtreecommitdiff
path: root/hw/fdc.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/fdc.h')
-rw-r--r--hw/fdc.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/hw/fdc.h b/hw/fdc.h
index 30ac970cc1..3b2fb3b248 100644
--- a/hw/fdc.h
+++ b/hw/fdc.h
@@ -1,18 +1,28 @@
#ifndef HW_FDC_H
#define HW_FDC_H
+#include "isa.h"
#include "blockdev.h"
/* fdc.c */
#define MAX_FD 2
-typedef struct FDCtrl FDCtrl;
+static inline void fdctrl_init_isa(DriveInfo **fds)
+{
+ ISADevice *dev;
-FDCtrl *fdctrl_init_isa(DriveInfo **fds);
-FDCtrl *fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
- target_phys_addr_t mmio_base, DriveInfo **fds);
-FDCtrl *sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
- DriveInfo **fds, qemu_irq *fdc_tc);
-FDriveType fdctrl_get_drive_type(FDCtrl *fdctrl, int drive_num);
+ dev = isa_create("isa-fdc");
+ 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);
+}
+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,
+ DriveInfo **fds, qemu_irq *fdc_tc);
#endif