2010-05-14 11:29:15 +04:00
|
|
|
#ifndef HW_FDC_H
|
|
|
|
#define HW_FDC_H
|
|
|
|
|
2011-02-05 19:32:23 +03:00
|
|
|
#include "isa.h"
|
2011-02-13 00:23:12 +03:00
|
|
|
#include "blockdev.h"
|
|
|
|
|
2007-11-17 20:14:51 +03:00
|
|
|
/* fdc.c */
|
|
|
|
#define MAX_FD 2
|
|
|
|
|
2011-02-05 19:32:23 +03:00
|
|
|
static inline void fdctrl_init_isa(DriveInfo **fds)
|
|
|
|
{
|
|
|
|
ISADevice *dev;
|
2007-11-17 20:14:51 +03:00
|
|
|
|
2011-02-13 01:25:26 +03:00
|
|
|
dev = isa_try_create("isa-fdc");
|
|
|
|
if (!dev) {
|
|
|
|
return;
|
|
|
|
}
|
2011-02-05 19:32:23 +03: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);
|
|
|
|
}
|
2010-05-14 11:29:15 +04:00
|
|
|
|
2011-02-05 19:32:23 +03: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);
|
2010-05-14 11:29:15 +04:00
|
|
|
#endif
|