#include <arch/i386.h>
#include <kernel/clock.h>
#include <kernel/console.h>
#include <kernel/IdeTimer.h>
#include <kernel/IdeLow.h>
#include <kernel/Ide.h>
#include <kernel/keyboard.h>
#include <kernel/task.h>
Go to the source code of this file.
Functions | |
void | GoIdle () |
void | Delay (dword ms) |
Timer_Struct | TimerStart (dword ms) |
int | TimerElapsed (Timer_Struct Timer) |
int | WaitForInt (Timer_Struct Timer) |
int | WaitForBsy (Timer_Struct Timer, word Port) |
void | AtapiDelay (int Dev) |
void | WaitKeyPress (char *Message) |
Variables | |
dword | ticks |
System ticks. | |
IdeChannel_Struct * | CurrentChannel |
Definition in file IdeTimer.c.
|
Definition at line 146 of file IdeTimer.c.
00147 { 00148 if ( CurrentChannel->Device[Dev].Type == CC_DEVTYPE_ATAPI ) 00149 delay(HDC_ATAPIDELAY); 00150 } |
|
Definition at line 44 of file IdeTimer.c.
00045 { 00046 00047 dword Start=ticks; 00048 // we work with integer and not float, we have resolution greater than 1 ms 00049 // so we must trunc at the tick higher expected 00050 dword Stop; 00051 byte Cross; 00052 if ( (ms*HZ)%1000 == 0 ) 00053 // We can wait exactely ms 00054 Stop=Start+ms*HZ/1000; 00055 else 00056 // We must wait little more than ms because our 00057 // timer resolution can't permit to wait exactely ms 00058 Stop=(Start+ms*HZ/1000)+1; 00059 00060 Cross=(Stop<Start); 00061 // need to pay attention while waiting 00062 // for overflow of ticks and overflow of Stop 00063 while ( Cross ? (ticks >= Start) || (ticks < Stop) : (ticks>=Start) && (ticks<Stop) ) 00064 GoIdle(); 00065 00066 } |
|
Definition at line 32 of file IdeTimer.c.
|
|
Definition at line 90 of file IdeTimer.c.
|
|
Definition at line 71 of file IdeTimer.c.
00072 { 00073 Timer_Struct Timer; 00074 Timer.Start=ticks; 00075 00076 if ( ms*HZ % 1000 == 0 ) 00077 // We can wait exactely ms 00078 Timer.Stop=Timer.Start+ms*HZ/1000; 00079 else 00080 // We must wait little more than ms because our 00081 // timer resolution can't permit to wait exactely ms 00082 Timer.Stop=(Timer.Start+ms*HZ/1000)+1; 00083 Timer.Cross=(Timer.Stop<Timer.Start); 00084 return Timer; 00085 } |
|
Definition at line 126 of file IdeTimer.c.
00127 { 00128 byte Status=0; 00129 00130 while (TRUE) 00131 { 00132 Status = InPortAta( Port ); // poll for not busy 00133 if ( ( Status & HDC_STAT_BSY ) == 0 ) 00134 return FALSE; 00135 00136 if ( TimerElapsed(Timer) ) // time out yet ? 00137 return TRUE; 00138 00139 GoIdle(); 00140 } 00141 } |
|
Definition at line 103 of file IdeTimer.c.
00104 { 00105 while (TRUE) 00106 { 00107 if (CurrentChannel->IntDone == TRUE) 00108 { 00109 // reset interrupt flag; 00110 CurrentChannel->IntDone=FALSE; 00111 return FALSE; 00112 } 00113 00114 if ( TimerElapsed(Timer) ) 00115 return TRUE; 00116 00117 GoIdle(); 00118 } 00119 } |
|
Definition at line 156 of file IdeTimer.c.
|
|
Definition at line 26 of file IdeTimer.c. |
|
System ticks.
Definition at line 25 of file IdeTimer.c. |