From owner-freebsd-hackers Sat Mar 11 00:17:51 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA19291 for hackers-outgoing; Sat, 11 Mar 1995 00:17:51 -0800 Received: from Root.COM (implode.Root.COM [198.145.90.1]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id AAA19285 for ; Sat, 11 Mar 1995 00:17:49 -0800 Received: from corbin.Root.COM (corbin.Root.COM [198.145.90.18]) by Root.COM (8.6.8/8.6.5) with ESMTP id AAA04162; Sat, 11 Mar 1995 00:17:37 -0800 Received: from localhost (localhost [127.0.0.1]) by corbin.Root.COM (8.6.9/8.6.5) with SMTP id AAA00172; Sat, 11 Mar 1995 00:17:37 -0800 Message-Id: <199503110817.AAA00172@corbin.Root.COM> X-Authentication-Warning: corbin.Root.COM: Host localhost didn't use HELO protocol To: brian@mediacity.com (Brian Litzinger) cc: freebsd-hackers@FreeBSD.org Subject: Re: Is the source the reference? In-reply-to: Your message of "Fri, 10 Mar 95 23:53:49 PST." From: David Greenman Reply-To: davidg@Root.COM Date: Sat, 11 Mar 1995 00:17:36 -0800 Sender: hackers-owner@FreeBSD.org Precedence: bulk >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