Subject: Re: Grrr: Small delays
To: David S. Miller <>
From: Chris G Demetriou <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU>
List: port-sun3
Date: 08/15/1995 11:48:41
>    Is there a standard way of delaying for less than 1 us in the kernel?
>    [ ... ]
> Is not the 'hz' variable available to your routines?  At boot time you
> could use it to calculate delay constants for the driver, perhaps
> implement a delay200ns() macro which will use this driver constant in
> a decrementing loop to get the accuracy you are looking for.

you could only do so via a timing loop (while (timeout--)).  No
machines supported by NetBSD have microsecond granularity supported
directly by clock interrupts, and few have cycle counters.

rather, i'd think that a routine like "delay 200ns" would be provided
to the machine-independent part of the driver by the machine-dependent
part, i.e. as one of the "interface" routines.  that's not an
unreasonable demand to place on the MD code (because, at worst, if
poor performance were OK, it could just define the function to