1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Index: ata.c
===================================================================
--- ata.c	(revision 28806)
+++ ata.c	(working copy)
@@ -36,6 +36,71 @@

 #define SECTOR_SIZE     (512)

+#ifndef ATA_READ_REG
+#define ATA_READ_REG(reg) (reg)
+#endif
+#ifndef ATA_WRITE_REG
+#define ATA_WRITE_REG(reg, value) (reg) = (value)
+#endif
+
+#ifndef STATUS_BSY
+#define STATUS_BSY (0x80)
+#endif
+#ifndef STATUS_RDY
+#define STATUS_RDY (0x40)
+#endif
+#ifndef STATUS_DRQ
+#define STATUS_DRQ (0x08)
+#endif
+#ifndef STATUS_ERR
+#define STATUS_ERR (0x01)
+#endif
+#ifndef STATUS_DF
+#define STATUS_DF (0x20)
+#endif
+#ifndef ERROR_IDNF
+#define ERROR_IDNF (0x10)
+#endif
+#ifndef ERROR_ABRT
+#define ERROR_ABRT (0x04)
+#endif
+#ifndef WRITE_PATTERN1
+#define WRITE_PATTERN1 (0xa5)
+#endif
+#ifndef WRITE_PATTERN2
+#define WRITE_PATTERN2 (0x5a)
+#endif
+#ifndef WRITE_PATTERN3
+#define WRITE_PATTERN3 (0xaa)
+#endif
+#ifndef WRITE_PATTERN4
+#define WRITE_PATTERN4 (0x55)
+#endif
+#ifndef READ_PATTERN1
+#define READ_PATTERN1 (0xa5)
+#endif
+#ifndef READ_PATTERN2
+#define READ_PATTERN2 (0x5a)
+#endif
+#ifndef READ_PATTERN3
+#define READ_PATTERN3 (0xaa)
+#endif
+#ifndef READ_PATTERN4
+#define READ_PATTERN4 (0x55)
+#endif
+#ifndef READ_PATTERN1_MASK
+#define READ_PATTERN1_MASK (0xff)
+#endif
+#ifndef READ_PATTERN2_MASK
+#define READ_PATTERN2_MASK (0xff)
+#endif
+#ifndef READ_PATTERN3_MASK
+#define READ_PATTERN3_MASK (0xff)
+#endif
+#ifndef READ_PATTERN4_MASK
+#define READ_PATTERN4_MASK (0xff)
+#endif
+
 #define ATA_FEATURE     ATA_ERROR

 #define ATA_STATUS      ATA_COMMAND