Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 1995 01:44:52 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        gibbs@estienne.CS.Berkeley.EDU, hackers@FreeBSD.org
Subject:   Re: DELAY()
Message-ID:  <199503171544.BAA22530@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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



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