summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-02-14 09:44:34 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-02-14 09:44:34 +0000
commitc4d8d970f6602c80d7362a41da8851dbbf59ae1b (patch)
tree7e8f936eae5c1854c006c4fe134c4c2ce6f91291 /firmware/drivers/ata.c
parent84706a4188cea193a5a095855c1068b1c31a3875 (diff)
downloadrockbox-c4d8d970f6602c80d7362a41da8851dbbf59ae1b.tar.gz
rockbox-c4d8d970f6602c80d7362a41da8851dbbf59ae1b.zip
The power-saving SLEEP patch by Simon Elén.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3259 a1c6a512-1295-4272-9138-f99709370657
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;