summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 79193d9800..e65200eea2 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -111,7 +111,8 @@ static int wait_for_bsy(void)
111{ 111{
112 int timeout = current_tick + HZ*10; 112 int timeout = current_tick + HZ*10;
113 while (TIME_BEFORE(current_tick, timeout) && (ATA_ALT_STATUS & STATUS_BSY)) 113 while (TIME_BEFORE(current_tick, timeout) && (ATA_ALT_STATUS & STATUS_BSY))
114 yield(); 114 sleep_thread();
115 wake_up_thread();
115 116
116 if (TIME_BEFORE(current_tick, timeout)) 117 if (TIME_BEFORE(current_tick, timeout))
117 return 1; 118 return 1;
@@ -131,7 +132,8 @@ static int wait_for_rdy(void)
131 132
132 while (TIME_BEFORE(current_tick, timeout) && 133 while (TIME_BEFORE(current_tick, timeout) &&
133 !(ATA_ALT_STATUS & STATUS_RDY)) 134 !(ATA_ALT_STATUS & STATUS_RDY))
134 yield(); 135 sleep_thread();
136 wake_up_thread();
135 137
136 if (TIME_BEFORE(current_tick, timeout)) 138 if (TIME_BEFORE(current_tick, timeout))
137 return STATUS_RDY; 139 return STATUS_RDY;