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));
96 typedef enum {IDE_CTRL_NOT_SPECIFIED,
99 IDE_CTRL_DUAL_PORT_CACHE} ide_controller_type;
102 struct ide_drive_id {
107 uint_t hard_sectors : 1;
108 uint_t no_soft_sectors : 1;
109 uint_t no_mfm_enc : 1;
110 uint_t head_switch_time : 1;
111 uint_t spnd_mot_ctrl : 1;
112 uint_t fixed_drive : 1;
113 uint_t removable_media : 1;
114 uint_t disk_speed1 : 1;
115 uint_t disk_speed2 : 1;
116 uint_t disk_speed3 : 1;
117 uint_t rpm_tolerance : 1;
118 uint_t data_strobe_offset : 1;
119 uint_t track_offset_option : 1;
120 uint_t fmt_speed_tol : 1;
121 uint_t cdrom_flag : 1;
123 uint16_t num_cylinders;
127 uint16_t bytes_per_track;
128 uint16_t bytes_per_sector;
129 uint16_t sectors_per_track;
133 uint8_t phase_lock_bytes;
136 uint16_t num_vendor_wds;
138 uint8_t serial_num[20]; // right aligned, padded with 0x20
141 uint16_t controller_type;
143 uint16_t buffer_size; // in 512 byte chunks
145 uint16_t num_ecc_bytes;
147 uint8_t firmware_rev[8]; // space padded
148 uint8_t model_num[40]; // space padded
150 uint16_t rw_multiples;
160 uint16_t min_PIO_cycle;
161 uint16_t min_DMA_cycle;
165 } __attribute__((packed));
166 } __attribute__((packed));
167 } __attribute__((packed));
170 #endif // ! __V3VEE__