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

NAME

6       ddi_intr_get_pri,  ddi_intr_set_pri  -  get  or set priority of a given
7       interrupt
8

SYNOPSIS

10       #include <sys/types.h>
11       #include <sys/conf.h>
12       #include <sys/ddi.h>
13       #include <sys/sunddi.h>
14
15       int ddi_intr_get_pri(ddi_intr_handle_t h, uint_t *prip);
16
17
18       int ddi_intr_set_pri(ddi_intr_handle_t h, uint_t pri);
19
20

INTERFACE LEVEL

22       Solaris DDI specific (Solaris DDI).
23

PARAMETERS

25       ddi_intr_get_pri()
26
27       h       DDI interrupt handle
28
29
30       prip    Pointer to the priority returned for this handle
31
32
33
34       ddi_intr_set_pri()
35
36       h      DDI interrupt handle
37
38
39       pri    Contains the priority to be set
40
41

DESCRIPTION

43       The ddi_intr_get_pri() function returns the  current  priority  of  the
44       interrupt  handle  h  of a given device. Upon a successful return, prip
45       points   to   a    small    integer    value,    typically    in    the
46       DDI_INTR_PRI_MIN...DDI_INTR_PRI_MAX  range, that represents the current
47       software priority setting for the interrupt. See  <sys/ddi_intr.h>  for
48       values of DDI_INTR_PRI_MIN or DDI_INTR_PRI_MAX.
49
50
51       The  ddi_intr_get_pri()  function  can  be called any time, even if the
52       driver adds an interrupt handler for the interrupt specification.
53
54
55       The software priority returned from ddi_intr_get_pri() can be  used  in
56       calls to mutex_init() and rw_init().
57
58
59       The  ddi_intr_set_pri() function sets the priority pri of the interrupt
60       handle h of a given device. The function validates that the argument is
61       within the supported range.
62
63
64       The  ddi_intr_set_pri() function can only be called prior to adding the
65       interrupt handler or when an interrupt handler is unassigned. DDI_FAIL‐
66       URE is returned in all other cases.
67

RETURN VALUES

69       The ddi_intr_get_pri() and ddi_intr_set_pri() functions return:
70
71       DDI_SUCCESS    On success.
72
73
74       DDI_EINVAL     On encountering invalid input parameters.
75
76
77       DDI_FAILURE    On any implementation specific failure.
78
79
80       DDI_ENOTSUP    On device not supporting operation.
81
82

CONTEXT

84       The  ddi_intr_get_pri()  and ddi_intr_set_pri() functions can be called
85       from kernel non-interrupt context.
86

ATTRIBUTES

88       See attributes(5) for descriptions of the following attributes:
89
90
91
92
93       ┌─────────────────────────────┬─────────────────────────────┐
94       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
95       ├─────────────────────────────┼─────────────────────────────┤
96       │Interface Stability          │Committed                    │
97       └─────────────────────────────┴─────────────────────────────┘
98

SEE ALSO

100       attributes(5), ddi_intr_alloc(9F), ddi_intr_enable(9F), mutex_init(9F),
101       rw_init(9F)
102
103
104       Writing Device Drivers
105

NOTES

107       The  priority  returned  from  ddi_intr_get_pri() should be typecast by
108       calling the DDI_INTR_PRI macro before passing it onto mutex_init(9F).
109
110
111       Consumers of these interfaces should verify that the  return  value  is
112       not  equal  to DDI_SUCCESS. Incomplete checking for failure codes could
113       result in inconsistent behavior among platforms.
114
115
116
117SunOS 5.11                        04 Jun 2007             ddi_intr_get_pri(9F)
Impressum