diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-02-14 09:44:34 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-02-14 09:44:34 +0000 |
commit | c4d8d970f6602c80d7362a41da8851dbbf59ae1b (patch) | |
tree | 7e8f936eae5c1854c006c4fe134c4c2ce6f91291 /firmware/drivers/ata.c | |
parent | 84706a4188cea193a5a095855c1068b1c31a3875 (diff) |
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.c | 6 |
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) { int timeout = current_tick + HZ*10; while (TIME_BEFORE(current_tick, timeout) && (ATA_ALT_STATUS & STATUS_BSY)) - yield(); + sleep_thread(); + wake_up_thread(); if (TIME_BEFORE(current_tick, timeout)) return 1; @@ -131,7 +132,8 @@ static int wait_for_rdy(void) while (TIME_BEFORE(current_tick, timeout) && !(ATA_ALT_STATUS & STATUS_RDY)) - yield(); + sleep_thread(); + wake_up_thread(); if (TIME_BEFORE(current_tick, timeout)) return STATUS_RDY; |