diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-09-15 19:23:34 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-09-15 19:23:34 +0000 |
commit | da4d04197aef7118d0483b5010c919d2986ac59c (patch) | |
tree | e6ea402211decb11b68ce6f9ea351c5bcae3ce7a /hw/ide/internal.h | |
parent | 88804180fd705d3c4f3dd50e0b9bd7b70c5db0ef (diff) |
ide/qdev: add ide bus.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/ide/internal.h')
-rw-r--r-- | hw/ide/internal.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/hw/ide/internal.h b/hw/ide/internal.h index 62aef1c3b0..9df759d4d3 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -15,6 +15,8 @@ #define USE_DMA_CDROM typedef struct IDEBus IDEBus; +typedef struct IDEDevice IDEDevice; +typedef struct IDEDeviceInfo IDEDeviceInfo; typedef struct IDEState IDEState; typedef struct BMDMAState BMDMAState; @@ -440,6 +442,8 @@ struct IDEState { struct IDEBus { BusState qbus; + IDEDevice *master; + IDEDevice *slave; BMDMAState *bmdma; IDEState ifs[2]; uint8_t unit; @@ -447,6 +451,20 @@ struct IDEBus { qemu_irq irq; }; +struct IDEDevice { + DeviceState qdev; + uint32_t unit; + DriveInfo *dinfo; +}; + +typedef int (*ide_qdev_initfn)(IDEDevice *dev); +struct IDEDeviceInfo { + DeviceInfo qdev; + ide_qdev_initfn init; + uint32_t unit; + DriveInfo *drive; +}; + #define BM_STATUS_DMAING 0x01 #define BM_STATUS_ERROR 0x02 #define BM_STATUS_INT 0x04 @@ -500,7 +518,7 @@ static inline void ide_set_irq(IDEBus *bus) } } -/* ide.c */ +/* hw/ide/core.c */ void ide_save(QEMUFile* f, IDEState *s); void ide_load(QEMUFile* f, IDEState *s, int version_id); void idebus_save(QEMUFile* f, IDEBus *bus); @@ -532,4 +550,8 @@ void ide_init2(IDEBus *bus, DriveInfo *hd0, DriveInfo *hd1, qemu_irq irq); void ide_init_ioport(IDEBus *bus, int iobase, int iobase2); +/* hw/ide/qdev.c */ +IDEBus *ide_bus_new(DeviceState *dev); +IDEDevice *ide_create_drive(IDEBus *bus, int unit, DriveInfo *drive); + #endif /* HW_IDE_INTERNAL_H */ |