67 lines
2.2 KiB
Plaintext
67 lines
2.2 KiB
Plaintext
.if n .pH ddi.rm/d3/gen/drv_usecwait @(#)drv_usecwait 43.10 of 12/9/92
|
|
.\" Copyright 1992, 1991 UNIX System Laboratories, Inc.
|
|
.TH drv_usecwait D3
|
|
.IX "\f4drv_usecwait\fP(D3)"
|
|
.SH NAME
|
|
\f4drv_usecwait\f1 \- busy-wait for specified interval
|
|
.SH SYNOPSIS
|
|
.nf
|
|
.na
|
|
.ft 4
|
|
#include <sys/types.h>
|
|
#include <sys/ddi.h>
|
|
.sp 0.4
|
|
void drv_usecwait(clock_t \f2microsecs\fP);
|
|
.ft 1
|
|
.ad
|
|
.fi
|
|
.SS Arguments
|
|
.RS 0
|
|
.IP "\f2microsecs\f1" 10n
|
|
The number of microseconds to busy-wait.
|
|
.RE
|
|
.SH DESCRIPTION
|
|
\f4drv_usecwait\f1 causes the caller to busy-wait for at least the number
|
|
of microseconds specified by \f2microsecs\f1.
|
|
The amount of time spent busy-waiting may be greater than the time specified
|
|
by \f2microsecs\f1 but will not be less.
|
|
.SS "Return Values"
|
|
None
|
|
.SH USAGE
|
|
\f4drv_usecwait\f1 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 \f4delay\f1(D3) function should be used instead since it
|
|
will not waste processor time busy-waiting as \f4drv_usecwait\f1 does.
|
|
.P
|
|
Because excessive busy-waiting is wasteful the driver should only
|
|
make calls to \f4drv_usecwait\f1 as needed, and only for as much time as
|
|
needed.
|
|
\f4drv_usecwait\f1 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.
|
|
.SS Level
|
|
Initialization, Base or Interrupt.
|
|
.SS "Synchronization Constraints"
|
|
Does not sleep.
|
|
.P
|
|
Driver-defined basic locks, read/write locks, and sleep locks
|
|
may be held across calls to this function.
|
|
.SS Warnings
|
|
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.
|
|
.SH REFERENCES
|
|
.na
|
|
\f4delay\fP(D3),
|
|
\f4drv_hztousec\fP(D3),
|
|
\f4drv_usectohz\fP(D3),
|
|
\f4itimeout\fP(D3),
|
|
\f4untimeout\fP(D3)
|
|
.ad
|