2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
21 #ifndef __DEVICES_IDE_TYPES_H__
22 #define __DEVICES_IDE_TYPES_H__
26 #include <palacios/vmm_types.h>
29 struct ide_error_reg {
33 uint_t addr_mark_nf : 1;
39 uint_t data_error : 1;
41 } __attribute__((packed));
42 } __attribute__((packed));
43 } __attribute__((packed));
46 struct ide_drive_head_reg {
55 } __attribute__((packed));
56 } __attribute__((packed));
57 } __attribute__((packed));
59 struct ide_status_reg {
67 uint_t seek_complete : 1;
68 uint_t write_fault : 1;
71 } __attribute__((packed));
72 } __attribute__((packed));
73 } __attribute__((packed));
81 uint_t irq_disable : 1;
82 uint_t soft_reset : 1;
84 } __attribute__((packed));
85 } __attribute__((packed));
86 } __attribute__((packed));
89 struct ide_features_reg {
92 } __attribute__((packed));
93 } __attribute__((packed));
95 typedef enum {IDE_CTRL_NOT_SPECIFIED,
98 IDE_CTRL_DUAL_PORT_CACHE} ide_controller_type;
100 struct ide_drive_id {
105 uint_t hard_sectors : 1;
106 uint_t no_soft_sectors : 1;
107 uint_t no_mfm_enc : 1;
108 uint_t head_switch_time : 1;
109 uint_t spnd_mot_ctrl : 1;
110 uint_t fixed_drive : 1;
111 uint_t removable_media : 1;
112 uint_t disk_speed1 : 1;
113 uint_t disk_speed2 : 1;
114 uint_t disk_speed3 : 1;
115 uint_t rpm_tolerance : 1;
116 uint_t data_strobe_offset : 1;
117 uint_t track_offset_option : 1;
118 uint_t fmt_speed_tol : 1;
119 uint_t cdrom_flag : 1;
121 uint16_t num_cylinders;
125 uint16_t bytes_per_track;
126 uint16_t bytes_per_sector;
127 uint16_t sectors_per_track;
131 uint8_t phase_lock_bytes;
134 uint16_t num_vendor_wds;
136 uint8_t serial_num[20]; // right aligned, padded with 0x20
139 uint16_t controller_type;
141 uint16_t buffer_size; // in 512 byte chunks
143 uint16_t num_ecc_bytes;
145 uint8_t firmware_rev[8]; // space padded
146 uint8_t model_num[40]; // space padded
148 uint16_t rw_multiples;
158 uint16_t min_PIO_cycle;
159 uint16_t min_DMA_cycle;
163 } __attribute__((packed));
164 } __attribute__((packed));
165 } __attribute__((packed));
168 #endif // ! __V3VEE__