fdc.h 827 字节
Newer Older
1 2 3
#ifndef HW_FDC_H
#define HW_FDC_H

B
Blue Swirl 已提交
4
#include "isa.h"
5 6
#include "blockdev.h"

P
pbrook 已提交
7 8 9
/* fdc.c */
#define MAX_FD 2

K
Kevin Wolf 已提交
10
static inline ISADevice *fdctrl_init_isa(DriveInfo **fds)
B
Blue Swirl 已提交
11 12
{
    ISADevice *dev;
P
pbrook 已提交
13

B
Blue Swirl 已提交
14 15
    dev = isa_try_create("isa-fdc");
    if (!dev) {
K
Kevin Wolf 已提交
16
        return NULL;
B
Blue Swirl 已提交
17
    }
K
Kevin Wolf 已提交
18

B
Blue Swirl 已提交
19 20 21 22 23 24 25
    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);
K
Kevin Wolf 已提交
26 27

    return dev;
B
Blue Swirl 已提交
28
}
29

B
Blue Swirl 已提交
30 31 32 33
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);
K
Kevin Wolf 已提交
34 35
void fdc_get_bs(BlockDriverState *bs[], ISADevice *dev);

36
#endif