diff options
Diffstat (limited to 'hw/ide/internal.h')
-rw-r--r-- | hw/ide/internal.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/hw/ide/internal.h b/hw/ide/internal.h index 00b28dfdbc..c808a0ddf8 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -21,7 +21,6 @@ typedef struct IDEBus IDEBus; typedef struct IDEDevice IDEDevice; -typedef struct IDEDeviceInfo IDEDeviceInfo; typedef struct IDEState IDEState; typedef struct IDEDMA IDEDMA; typedef struct IDEDMAOps IDEDMAOps; @@ -450,6 +449,19 @@ struct IDEBus { int error_status; }; +#define TYPE_IDE_DEVICE "ide-device" +#define IDE_DEVICE(obj) \ + OBJECT_CHECK(IDEDevice, (obj), TYPE_IDE_DEVICE) +#define IDE_DEVICE_CLASS(klass) \ + OBJECT_CLASS_CHECK(IDEDeviceClass, (klass), TYPE_IDE_DEVICE) +#define IDE_DEVICE_GET_CLASS(obj) \ + OBJECT_GET_CLASS(IDEDeviceClass, (obj), TYPE_IDE_DEVICE) + +typedef struct IDEDeviceClass { + DeviceClass parent_class; + int (*init)(IDEDevice *dev); +} IDEDeviceClass; + struct IDEDevice { DeviceState qdev; uint32_t unit; @@ -458,12 +470,6 @@ struct IDEDevice { char *serial; }; -typedef int (*ide_qdev_initfn)(IDEDevice *dev); -struct IDEDeviceInfo { - DeviceInfo qdev; - ide_qdev_initfn init; -}; - #define BM_STATUS_DMAING 0x01 #define BM_STATUS_ERROR 0x02 #define BM_STATUS_INT 0x04 |