Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


updated ide layer
[palacios.git] / palacios / src / devices / ide-types.h
1 /* 
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.  
5  *
6  * The V3VEE Project is a joint project between Northwestern University
7  * and the University of New Mexico.  You can find out more at 
8  * http://www.v3vee.org
9  *
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.
13  *
14  * Author: Jack Lange <jarusl@cs.northwestern.edu>
15  *
16  * This is free software.  You are permitted to use,
17  * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
18  */
19
20
21 #ifndef __DEVICES_IDE_TYPES_H__
22 #define __DEVICES_IDE_TYPES_H__
23
24 #ifdef __V3VEE__
25
26 #include <palacios/vmm_types.h>
27
28
29 struct ide_error_reg {
30     union {
31         uint8_t val;
32         struct {
33             uint_t addr_mark_nf     : 1;
34             uint_t track0_nf        : 1;
35             uint_t abort            : 1;
36             uint_t rsvd0            : 1;
37             uint_t ID_nf            : 1;
38             uint_t rsvd1            : 1;
39             uint_t data_error       : 1;
40             uint_t bad_block        : 1;
41         } __attribute__((packed));
42     } __attribute__((packed));
43 } __attribute__((packed));
44
45
46 struct ide_drive_head_reg {
47     union {
48         uint8_t val;
49         struct {
50             uint_t head_num      : 4;
51             uint_t drive_sel     : 1;
52             uint_t rsvd1         : 1;
53             uint_t lba_mode      : 1;
54             uint_t rsvd2         : 1;
55         } __attribute__((packed));
56     } __attribute__((packed));
57 } __attribute__((packed));
58
59 struct ide_status_reg {
60     union {
61         uint8_t val;
62         struct {
63             uint_t error         : 1;
64             uint_t index         : 1;
65             uint_t corrected     : 1;
66             uint_t data_req      : 1;
67             uint_t seek_complete : 1;
68             uint_t write_fault   : 1;
69             uint_t ready         : 1;
70             uint_t busy          : 1;
71         } __attribute__((packed));
72     } __attribute__((packed));
73 } __attribute__((packed));
74
75
76 struct ide_ctrl_reg {
77     union {
78         uint8_t val;
79         struct {
80             uint_t rsvd0        : 1;
81             uint_t irq_enable   : 1;
82             uint_t soft_reset   : 1;
83             uint_t rsvd1        : 5;
84         } __attribute__((packed));
85     } __attribute__((packed));
86 } __attribute__((packed));
87
88
89 struct ide_features_reg {
90     union {
91         uint8_t val;
92     } __attribute__((packed));
93 } __attribute__((packed));
94
95
96 typedef enum { 
97     READ_SECT_W_RETRY = 0x20,
98     READ_SECT = 0x21,
99     READ_LONG_W_RETRY = 0x22,
100     READ_LONG = 0x23,
101     READ_VRFY_SECT_W_RETRY = 0x40,
102     READ_VRFY_SECT = 0x41,
103     FORMAT_TRACK = 0x50,
104     EXEC_DRV_DIAG = 0x90,
105     INIT_DRIVE_PARAM = 0x91,
106
107 } ide_cmd_t;
108
109
110
111
112 #endif // ! __V3VEE__
113
114 #endif