drv_usecwait(D3DK) —
.IX \f4drv_usecwait\fP(D3DK)
NAME
drv_usecwait − busy-wait for specified interval
SYNOPSIS
#include <sys/types.h>
#include <sys/ddi.h>
void drv_usecwait(clock_t microsecs);
ARGUMENTS
microsecsThe number of microseconds to busy-wait.
DESCRIPTION
drv_usecwait causes the caller to busy-wait for at least the number of microseconds specified by microsecs. The amount of time spent busy-waiting may be greater than the time specified by microsecs but will not be less. drv_usecwait should only be used to wait for short periods of time (less than a clock tick) or when it is necessary to wait without sleeping (for example, at interrupt level). When the desired delay is at least as long as clock tick and it is possible to sleep, the delay(D3DK) function should be used instead since it will not waste processor time busy-waiting as drv_usecwait does.
Because excessive busy-waiting is wasteful the driver should only make calls to drv_usecwait as needed, and only for as much time as needed. drv_usecwait does not raise the interrupt priority level; if the driver wishes to block interrupts for the duration of the wait, it is the driver’s responsibility to set the priority level before the call and restore it to its original value afterward.
RETURN VALUE
None.
LEVEL
Base or Interrupt.
NOTES
Does not sleep.
Driver-defined basic locks, read/write locks, and sleep locks may be held across calls to this function.
Busy-waiting can increase the preemption latency experienced by high priority processes. Since short and bounded preemption latency can be critical in a real time environment, drivers intended for use in such an environment should not use this interface or should limit the length of the wait to an appropriately short length of time.
SEE ALSO
delay(D3DK), drv_hztousec(D3DK), drv_usectohz(D3DK), itimeout(D3DK), untimeout(D3DK)
DDI/DKI