Subject: Small delays
To: None <port-sun3@NetBSD.ORG, port-sparc@NetBSD.ORG>
From: David Jones <dej@eecg.toronto.edu>
List: port-sparc
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:

wait_req_true:
 while (req not true)
  delay(1);

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

while (req not true)
  delay200ns();

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

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: dej@eecg.toronto.edu, finger for PGP public key
         For a good time, telnet torfree.net and log in as `guest'.
          Click me!