1drv_usecwait(9F)         Kernel Functions for Drivers         drv_usecwait(9F)
2
3
4

NAME

6       drv_usecwait - busy-wait for specified interval
7

SYNOPSIS

9       #include <sys/types.h>
10       #include <sys/ddi.h>
11
12
13
14       void drv_usecwait(clock_t microsecs);
15
16

INTERFACE LEVEL

18       Architecture independent level 1 (DDI/DKI).
19

PARAMETERS

21       microsecs    The number of microseconds to busy-wait.
22
23

DESCRIPTION

25       The drv_usecwait() function gives drivers a means of busy-waiting for a
26       specified microsecond count. The amount of time spent busy-waiting  may
27       be  greater than the microsecond count but will minimally be the number
28       of microseconds specified.
29
30
31       delay(9F) can be used by a driver to delay for a  specified  number  of
32       system ticks, but it has two limitations. First, the granularity of the
33       wait time is limited to one clock tick, which may be more time than  is
34       needed  for  the  delay.  Second, delay(9F) can be invoked from user or
35       kernel context and hence cannot be used at  interrupt  time  or  system
36       initialization.
37
38
39       Often, drivers need to delay for only a few microseconds, waiting for a
40       write to a device register to be picked up by the device. In this case,
41       even in user context, delay(9F) produces too long a wait period.
42

CONTEXT

44       The drv_usecwait() function can be called from user, interrupt, or ker‐
45       nel context.
46

SEE ALSO

48       delay(9F), timeout(9F), untimeout(9F)
49
50
51       Writing Device Drivers
52

NOTES

54       The  driver  wastes  processor  time  by   making   this   call   since
55       drv_usecwait()  does not block but simply busy-waits. The driver should
56       only make calls to drv_usecwait() as needed, and only for as much  time
57       as needed. The drv_usecwait() function does not mask out interrupts.
58
59
60
61SunOS 5.11                        16 Jan 2006                 drv_usecwait(9F)
Impressum