From c4d8d970f6602c80d7362a41da8851dbbf59ae1b Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Fri, 14 Feb 2003 09:44:34 +0000 Subject: The power-saving SLEEP patch by Simon Elén. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3259 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/ata.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'firmware/drivers/ata.c') 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; -- cgit v1.2.3