Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / ide / ide-bus.h
blob4841a7dcd6365c2f0ac098ebfaf0bfa06739c583
1 #ifndef HW_IDE_BUS_H
2 #define HW_IDE_BUS_H
4 #include "exec/ioport.h"
5 #include "hw/ide/ide-dev.h"
6 #include "hw/ide/ide-dma.h"
8 struct IDEBus {
9 BusState qbus;
10 IDEDevice *master;
11 IDEDevice *slave;
12 IDEState ifs[2];
13 QEMUBH *bh;
15 int bus_id;
16 int max_units;
17 IDEDMA *dma;
18 uint8_t unit;
19 uint8_t cmd;
20 qemu_irq irq; /* bus output */
22 int error_status;
23 uint8_t retry_unit;
24 int64_t retry_sector_num;
25 uint32_t retry_nsector;
26 PortioList portio_list;
27 PortioList portio2_list;
28 VMChangeStateEntry *vmstate;
31 #define TYPE_IDE_BUS "IDE"
32 OBJECT_DECLARE_SIMPLE_TYPE(IDEBus, IDE_BUS)
34 void ide_bus_init(IDEBus *idebus, size_t idebus_size, DeviceState *dev,
35 int bus_id, int max_units);
36 IDEDevice *ide_bus_create_drive(IDEBus *bus, int unit, DriveInfo *drive);
38 int ide_get_geometry(BusState *bus, int unit,
39 int16_t *cyls, int8_t *heads, int8_t *secs);
40 int ide_get_bios_chs_trans(BusState *bus, int unit);
42 #endif