Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Mar 1995 00:17:36 -0800
From:      David Greenman <davidg@Root.COM>
To:        brian@mediacity.com (Brian Litzinger)
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: Is the source the reference? 
Message-ID:  <199503110817.AAA00172@corbin.Root.COM>
In-Reply-To: Your message of "Fri, 10 Mar 95 23:53:49 PST." <m0rnLzi-000rcEC@easynet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>Does DELAY() do what I expect?  Some of the drivers seem to
>use other strategies for achieveing this affect.

   It can provide an accurate delay at startup time (during probes and
things), but generally should not be used at later times as it just eats
the CPU. It is also only accurate for delays greater than about 10us. For
very short delays, there is a convention for using inb(0x84) to provide
about 1.25us delay. This mechanism is being phased out, however, as some
newer machines execute these much faster.

>Also, I'm in need if a 'do { } while (!done && !timeout)'.  Is there
>a recommended way to implement this in device drivers.

   The usual way is just to decrement a variable to implement the timeout, and
calibrate the variable value to the desired delay. Any other mechanism is
probably too high of overhead to consider.

-DG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503110817.AAA00172>