diff options
-rw-r--r-- | firmware/drivers/ata.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 39bff50d33..845fb79e80 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -79,6 +79,7 @@ static char ata_thread_name[] = "ata"; | |||
79 | static struct event_queue ata_queue; | 79 | static struct event_queue ata_queue; |
80 | static bool initialized = false; | 80 | static bool initialized = false; |
81 | 81 | ||
82 | static int wait_for_bsy(void) __attribute__ ((section (".icode"))); | ||
82 | static int wait_for_bsy(void) | 83 | static int wait_for_bsy(void) |
83 | { | 84 | { |
84 | int timeout = current_tick + HZ*4; | 85 | int timeout = current_tick + HZ*4; |
@@ -95,6 +96,7 @@ static int wait_for_bsy(void) | |||
95 | } | 96 | } |
96 | } | 97 | } |
97 | 98 | ||
99 | static int wait_for_rdy(void) __attribute__ ((section (".icode"))); | ||
98 | static int wait_for_rdy(void) | 100 | static int wait_for_rdy(void) |
99 | { | 101 | { |
100 | if (!wait_for_bsy()) | 102 | if (!wait_for_bsy()) |
@@ -102,6 +104,7 @@ static int wait_for_rdy(void) | |||
102 | return ATA_ALT_STATUS & STATUS_RDY; | 104 | return ATA_ALT_STATUS & STATUS_RDY; |
103 | } | 105 | } |
104 | 106 | ||
107 | static int wait_for_start_of_transfer(void) __attribute__ ((section (".icode"))); | ||
105 | static int wait_for_start_of_transfer(void) | 108 | static int wait_for_start_of_transfer(void) |
106 | { | 109 | { |
107 | if (!wait_for_bsy()) | 110 | if (!wait_for_bsy()) |
@@ -109,6 +112,7 @@ static int wait_for_start_of_transfer(void) | |||
109 | return (ATA_ALT_STATUS & (STATUS_BSY|STATUS_DRQ)) == STATUS_DRQ; | 112 | return (ATA_ALT_STATUS & (STATUS_BSY|STATUS_DRQ)) == STATUS_DRQ; |
110 | } | 113 | } |
111 | 114 | ||
115 | static int wait_for_end_of_transfer(void) __attribute__ ((section (".icode"))); | ||
112 | static int wait_for_end_of_transfer(void) | 116 | static int wait_for_end_of_transfer(void) |
113 | { | 117 | { |
114 | if (!wait_for_bsy()) | 118 | if (!wait_for_bsy()) |
@@ -118,6 +122,9 @@ static int wait_for_end_of_transfer(void) | |||
118 | 122 | ||
119 | int ata_read_sectors(unsigned long start, | 123 | int ata_read_sectors(unsigned long start, |
120 | unsigned char count, | 124 | unsigned char count, |
125 | void* buf) __attribute__ ((section (".icode"))); | ||
126 | int ata_read_sectors(unsigned long start, | ||
127 | unsigned char count, | ||
121 | void* buf) | 128 | void* buf) |
122 | { | 129 | { |
123 | int i; | 130 | int i; |