root / hw / fdc.h @ 4e4fa398
History | View | Annotate | Download (845 Bytes)
1 | 845773ab | Isaku Yamahata | #ifndef HW_FDC_H
|
---|---|---|---|
2 | 845773ab | Isaku Yamahata | #define HW_FDC_H
|
3 | 845773ab | Isaku Yamahata | |
4 | 63ffb564 | Blue Swirl | #include "isa.h" |
5 | d288c7ba | Blue Swirl | #include "blockdev.h" |
6 | d288c7ba | Blue Swirl | |
7 | 87ecb68b | pbrook | /* fdc.c */
|
8 | 87ecb68b | pbrook | #define MAX_FD 2 |
9 | 87ecb68b | pbrook | |
10 | 48a18b3c | Hervé Poussineau | static inline ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds) |
11 | 63ffb564 | Blue Swirl | { |
12 | 63ffb564 | Blue Swirl | ISADevice *dev; |
13 | 87ecb68b | pbrook | |
14 | 48a18b3c | Hervé Poussineau | dev = isa_try_create(bus, "isa-fdc");
|
15 | 17801c78 | Blue Swirl | if (!dev) {
|
16 | 34d4260e | Kevin Wolf | return NULL; |
17 | 17801c78 | Blue Swirl | } |
18 | 34d4260e | Kevin Wolf | |
19 | 63ffb564 | Blue Swirl | if (fds[0]) { |
20 | 63ffb564 | Blue Swirl | qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv); |
21 | 63ffb564 | Blue Swirl | } |
22 | 63ffb564 | Blue Swirl | if (fds[1]) { |
23 | 63ffb564 | Blue Swirl | qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv); |
24 | 63ffb564 | Blue Swirl | } |
25 | 63ffb564 | Blue Swirl | qdev_init_nofail(&dev->qdev); |
26 | 34d4260e | Kevin Wolf | |
27 | 34d4260e | Kevin Wolf | return dev;
|
28 | 63ffb564 | Blue Swirl | } |
29 | 845773ab | Isaku Yamahata | |
30 | 63ffb564 | Blue Swirl | void fdctrl_init_sysbus(qemu_irq irq, int dma_chann, |
31 | 63ffb564 | Blue Swirl | target_phys_addr_t mmio_base, DriveInfo **fds); |
32 | 63ffb564 | Blue Swirl | void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
|
33 | 63ffb564 | Blue Swirl | DriveInfo **fds, qemu_irq *fdc_tc); |
34 | 34d4260e | Kevin Wolf | void fdc_get_bs(BlockDriverState *bs[], ISADevice *dev);
|
35 | 34d4260e | Kevin Wolf | |
36 | 845773ab | Isaku Yamahata | #endif |