2010-05-14 09:29:15 +02:00
|
|
|
#ifndef HW_FDC_H
|
|
|
|
#define HW_FDC_H
|
|
|
|
|
2011-02-05 17:32:23 +01:00
|
|
|
#include "isa.h"
|
2011-02-12 22:23:12 +01:00
|
|
|
#include "blockdev.h"
|
|
|
|
|
2007-11-17 18:14:51 +01:00
|
|
|
/* fdc.c */
|
|
|
|
#define MAX_FD 2
|
|
|
|
|
2011-12-15 22:09:51 +01:00
|
|
|
static inline ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds)
|
2011-02-05 17:32:23 +01:00
|
|
|
{
|
|
|
|
ISADevice *dev;
|
2007-11-17 18:14:51 +01:00
|
|
|
|
2011-12-15 22:09:51 +01:00
|
|
|
dev = isa_try_create(bus, "isa-fdc");
|
2011-02-12 23:25:26 +01:00
|
|
|
if (!dev) {
|
2011-10-20 16:37:26 +02:00
|
|
|
return NULL;
|
2011-02-12 23:25:26 +01:00
|
|
|
}
|
2011-10-20 16:37:26 +02:00
|
|
|
|
2011-02-05 17:32:23 +01:00
|
|
|
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);
|
2011-10-20 16:37:26 +02:00
|
|
|
|
|
|
|
return dev;
|
2011-02-05 17:32:23 +01:00
|
|
|
}
|
2010-05-14 09:29:15 +02:00
|
|
|
|
2011-02-05 17:32:23 +01:00
|
|
|
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);
|
2011-10-20 16:37:26 +02:00
|
|
|
void fdc_get_bs(BlockDriverState *bs[], ISADevice *dev);
|
|
|
|
|
2010-05-14 09:29:15 +02:00
|
|
|
#endif
|