Subversion Repositories HelenOS

Rev

Rev 4537 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4537 Rev 4668
Line 34... Line 34...
34
 
34
 
35
#ifndef __ATA_BD_H__
35
#ifndef __ATA_BD_H__
36
#define __ATA_BD_H__
36
#define __ATA_BD_H__
37
 
37
 
38
#include <sys/types.h>
38
#include <sys/types.h>
-
 
39
#include <fibril_sync.h>
39
 
40
 
40
enum {
41
enum {
41
    CTL_READ_START  = 0,
42
    CTL_READ_START  = 0,
42
    CTL_WRITE_START = 1,
43
    CTL_WRITE_START = 1,
43
};
44
};
Line 48... Line 49...
48
 
49
 
49
enum {
50
enum {
50
    MAX_DISKS   = 2
51
    MAX_DISKS   = 2
51
};
52
};
52
 
53
 
-
 
54
/** ATA Command Register Block. */
53
typedef union {
55
typedef union {
54
    /* Read */
56
    /* Read/Write */
55
    struct {
57
    struct {
56
        uint8_t data_port;
58
        uint16_t data_port;
57
        uint8_t error;
-
 
58
        uint8_t sector_count;
59
        uint8_t sector_count;
59
        uint8_t sector_number;
60
        uint8_t sector_number;
60
        uint8_t cylinder_low;
61
        uint8_t cylinder_low;
61
        uint8_t cylinder_high;
62
        uint8_t cylinder_high;
62
        uint8_t drive_head;
63
        uint8_t drive_head;
-
 
64
        uint8_t pad_rw0;       
-
 
65
    };
-
 
66
 
-
 
67
    /* Read Only */
-
 
68
    struct {
-
 
69
        uint8_t pad_ro0;
-
 
70
        uint8_t error;
-
 
71
        uint8_t pad_ro1[5];
63
        uint8_t status;
72
        uint8_t status;
64
    };
73
    };
65
 
74
 
66
    /* Write */
75
    /* Write Only */
67
    struct {
76
    struct {
68
        uint8_t pad0[7];
77
        uint8_t pad_wo0;
-
 
78
        uint8_t features;
-
 
79
        uint8_t pad_wo1[5];
69
        uint8_t command;
80
        uint8_t command;
70
    };
81
    };
71
} ata_cmd_t;
82
} ata_cmd_t;
72
 
83
 
73
typedef union {
84
typedef union {
Line 127... Line 138...
127
    bool present;
138
    bool present;
128
    unsigned heads;
139
    unsigned heads;
129
    unsigned cylinders;
140
    unsigned cylinders;
130
    unsigned sectors;
141
    unsigned sectors;
131
    uint64_t blocks;
142
    uint64_t blocks;
-
 
143
 
-
 
144
    fibril_mutex_t lock;
-
 
145
    dev_handle_t dev_handle;
132
} disk_t;
146
} disk_t;
133
 
147
 
134
#endif
148
#endif
135
 
149
 
136
/** @}
150
/** @}