[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Short sleeps.
- To: <linuxgames@sunsite.dk>
- Subject: Re: Short sleeps.
- From: "Vesselin I. Peev" <vesselinpeev@hotmail.com>
- Date: Thu, 10 Jan 2002 10:34:21 +0100
- Delivered-To: archiver@seul.org
- Delivered-To: mailing list linuxgames@sunsite.dk
- Delivery-Date: Fri, 11 Jan 2002 03:35:21 -0500
- Disposition-Notification-To: "Vesselin I. Peev" <vesselinpeev@hotmail.com>
- Mailing-List: contact linuxgames-help@sunsite.dk; run by ezmlm
- References: <3C3E38EA.954877C8@airmail.net>
- Reply-To: linuxgames@sunsite.dk
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. "