Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ddi_intr_get_pri.9f
blobe1753b64b82c041c32efe04f51b30b8bf4c84539
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH DDI_INTR_GET_PRI 9F "Jun 04, 2007"
7 .SH NAME
8 ddi_intr_get_pri, ddi_intr_set_pri \- get or set priority of a given interrupt
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/types.h>
13 #include <sys/conf.h>
14 #include <sys/ddi.h>
15 #include <sys/sunddi.h>
17 \fBint\fR \fBddi_intr_get_pri\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBuint_t\fR *\fIprip\fR);
18 .fi
20 .LP
21 .nf
22 \fBint\fR \fBddi_intr_set_pri\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBuint_t\fR \fIpri\fR);
23 .fi
25 .SH INTERFACE LEVEL
26 .sp
27 .LP
28 Solaris DDI specific (Solaris DDI).
29 .SH PARAMETERS
30 .sp
31 .LP
32 \fBddi_intr_get_pri()\fR
33 .sp
34 .ne 2
35 .na
36 \fB\fIh\fR\fR
37 .ad
38 .RS 8n
39 DDI interrupt handle
40 .RE
42 .sp
43 .ne 2
44 .na
45 \fB\fIprip\fR\fR
46 .ad
47 .RS 8n
48 Pointer to the priority returned for this handle
49 .RE
51 .sp
52 .LP
53 \fBddi_intr_set_pri()\fR
54 .sp
55 .ne 2
56 .na
57 \fB\fIh\fR\fR
58 .ad
59 .RS 7n
60 DDI interrupt handle
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fIpri\fR\fR
67 .ad
68 .RS 7n
69 Contains the priority to be set
70 .RE
72 .SH DESCRIPTION
73 .sp
74 .LP
75 The \fBddi_intr_get_pri()\fR function returns the current priority of the
76 interrupt handle \fIh\fR of a given device. Upon a successful return,
77 \fIprip\fR points to a small integer value, typically in the
78 \fBDDI_INTR_PRI_MIN\fR...\fBDDI_INTR_PRI_MAX\fR range, that represents the
79 current software priority setting for the interrupt. See <\fBsys/ddi_intr.h\fR>
80 for values of \fBDDI_INTR_PRI_MIN\fR or \fBDDI_INTR_PRI_MAX\fR.
81 .sp
82 .LP
83 The \fBddi_intr_get_pri()\fR function can be called any time, even if the
84 driver adds an interrupt handler for the interrupt specification.
85 .sp
86 .LP
87 The software priority returned from \fBddi_intr_get_pri()\fR can be used in
88 calls to \fBmutex_init()\fR and \fBrw_init()\fR.
89 .sp
90 .LP
91 The \fBddi_intr_set_pri()\fR function sets the priority \fIpri\fR of the
92 interrupt handle \fIh\fR of a given device. The function validates that the
93 argument is within the supported range.
94 .sp
95 .LP
96 The \fBddi_intr_set_pri()\fR function can only be called prior to adding the
97 interrupt handler or when an interrupt handler is unassigned. \fBDDI_FAILURE\fR
98 is returned in all other cases.
99 .SH RETURN VALUES
102 The \fBddi_intr_get_pri()\fR and \fBddi_intr_set_pri()\fR functions return:
104 .ne 2
106 \fB\fBDDI_SUCCESS\fR\fR
108 .RS 15n
109 On success.
113 .ne 2
115 \fB\fBDDI_EINVAL\fR\fR
117 .RS 15n
118 On encountering invalid input parameters.
122 .ne 2
124 \fB\fBDDI_FAILURE\fR\fR
126 .RS 15n
127 On any implementation specific failure.
131 .ne 2
133 \fB\fBDDI_ENOTSUP\fR\fR
135 .RS 15n
136 On device not supporting operation.
139 .SH CONTEXT
142 The \fBddi_intr_get_pri()\fR and \fBddi_intr_set_pri()\fR functions can be
143 called from kernel non-interrupt context.
144 .SH ATTRIBUTES
147 See \fBattributes\fR(5) for descriptions of the following attributes:
152 box;
153 c | c
154 l | l .
155 ATTRIBUTE TYPE  ATTRIBUTE VALUE
157 Interface Stability     Committed
160 .SH SEE ALSO
163 \fBattributes\fR(5), \fBddi_intr_alloc\fR(9F), \fBddi_intr_enable\fR(9F),
164 \fBmutex_init\fR(9F), \fBrw_init\fR(9F)
167 \fIWriting Device Drivers\fR
168 .SH NOTES
171 The priority returned from \fBddi_intr_get_pri()\fR should be typecast by
172 calling the \fBDDI_INTR_PRI\fR macro before passing it onto
173 \fBmutex_init\fR(9F).
176 Consumers of these interfaces should verify that the return value is not equal
177 to \fBDDI_SUCCESS\fR. Incomplete checking for failure codes could result in
178 inconsistent behavior among platforms.