[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Short sleeps.



Here's a possible solution from
http://www.linuxdoc.org/HOWTO/mini/IO-Port-Programming-4.html

"Another way of delaying small numbers of microseconds is port I/O.
Inputting or outputting any byte from/to port 0x80 (see above for how to do
it) should wait for almost exactly 1 microsecond independent of your
processor type and speed. You can do this multiple times to wait a few
microseconds. The port output should have no harmful side effects on any
standard machine (and some kernel drivers use it). This is how
{in|out}[bw]_p() normally do the delay (see asm/io.h).
Actually, a port I/O instruction on most ports in the 0-0x3ff range takes
almost exactly 1 microsecond, so if you're, for example, using the parallel
port directly, just do additional inb()s from that port to delay. "