6 #include <palacios/vmm_types.h>
10 typedef sint32_t ssize_t;
11 typedef unsigned int rd_bool;
12 typedef uchar_t Bit8u;
13 typedef ushort_t Bit16u;
14 typedef uint32_t Bit32u;
15 typedef uint64_t Bit64u;
22 SENSE_ILLEGAL_REQUEST = 5,
23 SENSE_UNIT_ATTENTION = 6
27 ASC_INV_FIELD_IN_CMD_PACKET = 0x24,
28 ASC_MEDIUM_NOT_PRESENT = 0x3a,
29 ASC_SAVING_PARAMETERS_NOT_SUPPORTED = 0x39,
30 ASC_LOGICAL_BLOCK_OOR = 0x21
44 struct interrupt_reason_t {
52 struct controller_status {
56 rd_bool seek_complete;
58 rd_bool corrected_data;
60 unsigned int index_pulse_count;
89 struct error_recovery_t {
90 unsigned char data[8];
97 struct cdrom_interface * cd;
101 int remaining_blocks;
103 struct currentStruct {
104 struct error_recovery_t error_recovery;
112 int total_bytes_remaining;
116 typedef enum { IDE_NONE, IDE_DISK, IDE_CDROM } device_type_t;
118 struct controller_t {
119 struct controller_status status;
120 Bit8u error_register;
125 struct interrupt_reason_t interrupt_reason;
139 Bit8u current_command;
140 Bit8u sectors_per_block;
144 rd_bool reset; // 0=normal, 1=reset controller
145 rd_bool disable_irq; // 0=allow irq, 1=disable irq
148 Bit8u reset_in_progress;
156 device_image_t hard_drive;
157 device_type_t device_type;
158 // 512 byte buffer for ID drive command
159 // These words are stored in native word endian format, as
160 // they are fetched and returned via a return(), so
161 // there's no need to keep them in x86 endian format.
162 Bit16u id_drive[256];
164 struct controller_t controller;
165 struct cdrom_t cdrom;
166 struct sense_info_t sense;
167 struct atapi_t atapi;
174 // For each ATA channel we should have one controller struct
175 // and an array of two drive structs
177 struct drive_t drives[2];
178 unsigned drive_select;
196 #endif // ! __V3VEE__