From owner-freebsd-hackers Fri Mar 17 09:41:26 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id JAA00319 for hackers-outgoing; Fri, 17 Mar 1995 09:41:26 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id JAA00310 for ; Fri, 17 Mar 1995 09:41:19 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id BAA22530; Sat, 18 Mar 1995 01:44:52 +1000 Date: Sat, 18 Mar 1995 01:44:52 +1000 From: Bruce Evans Message-Id: <199503171544.BAA22530@godzilla.zeta.org.au> To: gibbs@estienne.CS.Berkeley.EDU, hackers@FreeBSD.org Subject: Re: DELAY() Sender: hackers-owner@FreeBSD.org Precedence: bulk >Does anyone have an alternate implementation idea for DELAY so that it >is cpu/bus independant? I just tracked down the problem with the DELAY() is supposed to be cpu/bus independent, but it guesses how long it takes to start up so the delay may be short by 20 usec on an infinitely fast machine, and of course no upper bound on the delay can be guaranteed because interrupts may increase it. It should use a different strategy for small delays and calibrate all overheads and recalibrate all overheads when the delay is sufficiently lonf to allow recalibration. >aic7870 based cards, and it turned out that what should have been a >milisecond delay was so short on this P-90 system that I repolled DELAY(1000) should work, but `for (i = 0; i < 50; i++) if (foo()) break; DELAY(20);' might not. I'd try a combination of short delays (inb(0x84)) together with calls to microtime() to poll like this. Bruce