Subject: Small delays
To: None <port-sun3@NetBSD.ORG, port-sparc@NetBSD.ORG>
From: David Jones <>
List: port-sun3
Date: 08/14/1995 12:23:11
Is there a standard way of delaying for less than 1 us in the kernel?

The ncr5380 requires that the REQ/ACK handshake be done in software if DMA
is not used.  I have code that looks like this:

 while (req not true)

This works, but gives you lousy transfer rates.  I'd like to do something

while (req not true)

This is not out of the range of any CPU, but I'd rather not use something

timo = 100;
while (not true && --timo);

Which gives you a delay highly dependent on the CPU speed.  There's a BIG
difference between a Sun 3/50 and a SparcServer 670 using Ross modules
(both machines could conceivably run the si driver).

The ncr5380 code is going to be universally portable, so for now I'm sticking
to delay().

Any ideas?  Of course this is not so much a problem once I get DMA going...

David Jones, M.A.Sc student, Electronics Group (VLSI), University of Toronto
           email:, finger for PGP public key
         For a good time, telnet and log in as `guest'.
          Click me!