summaryrefslogtreecommitdiff
path: root/usr/src/man/man9f/ddi_intr_get_pri.9f
blob: e1753b64b82c041c32efe04f51b30b8bf4c84539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
'\" te
.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.\" 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.
.\" 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.
.\" 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]
.TH DDI_INTR_GET_PRI 9F "Jun 04, 2007"
.SH NAME
ddi_intr_get_pri, ddi_intr_set_pri \- get or set priority of a given interrupt
.SH SYNOPSIS
.LP
.nf
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>

\fBint\fR \fBddi_intr_get_pri\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBuint_t\fR *\fIprip\fR);
.fi

.LP
.nf
\fBint\fR \fBddi_intr_set_pri\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBuint_t\fR \fIpri\fR);
.fi

.SH INTERFACE LEVEL
.sp
.LP
Solaris DDI specific (Solaris DDI).
.SH PARAMETERS
.sp
.LP
\fBddi_intr_get_pri()\fR
.sp
.ne 2
.na
\fB\fIh\fR\fR
.ad
.RS 8n
DDI interrupt handle
.RE

.sp
.ne 2
.na
\fB\fIprip\fR\fR
.ad
.RS 8n
Pointer to the priority returned for this handle
.RE

.sp
.LP
\fBddi_intr_set_pri()\fR
.sp
.ne 2
.na
\fB\fIh\fR\fR
.ad
.RS 7n
DDI interrupt handle
.RE

.sp
.ne 2
.na
\fB\fIpri\fR\fR
.ad
.RS 7n
Contains the priority to be set
.RE

.SH DESCRIPTION
.sp
.LP
The \fBddi_intr_get_pri()\fR function returns the current priority of the
interrupt handle \fIh\fR of a given device. Upon a successful return,
\fIprip\fR points to a small integer value, typically in the
\fBDDI_INTR_PRI_MIN\fR...\fBDDI_INTR_PRI_MAX\fR range, that represents the
current software priority setting for the interrupt. See <\fBsys/ddi_intr.h\fR>
for values of \fBDDI_INTR_PRI_MIN\fR or \fBDDI_INTR_PRI_MAX\fR.
.sp
.LP
The \fBddi_intr_get_pri()\fR function can be called any time, even if the
driver adds an interrupt handler for the interrupt specification.
.sp
.LP
The software priority returned from \fBddi_intr_get_pri()\fR can be used in
calls to \fBmutex_init()\fR and \fBrw_init()\fR.
.sp
.LP
The \fBddi_intr_set_pri()\fR function sets the priority \fIpri\fR of the
interrupt handle \fIh\fR of a given device. The function validates that the
argument is within the supported range.
.sp
.LP
The \fBddi_intr_set_pri()\fR function can only be called prior to adding the
interrupt handler or when an interrupt handler is unassigned. \fBDDI_FAILURE\fR
is returned in all other cases.
.SH RETURN VALUES
.sp
.LP
The \fBddi_intr_get_pri()\fR and \fBddi_intr_set_pri()\fR functions return:
.sp
.ne 2
.na
\fB\fBDDI_SUCCESS\fR\fR
.ad
.RS 15n
On success.
.RE

.sp
.ne 2
.na
\fB\fBDDI_EINVAL\fR\fR
.ad
.RS 15n
On encountering invalid input parameters.
.RE

.sp
.ne 2
.na
\fB\fBDDI_FAILURE\fR\fR
.ad
.RS 15n
On any implementation specific failure.
.RE

.sp
.ne 2
.na
\fB\fBDDI_ENOTSUP\fR\fR
.ad
.RS 15n
On device not supporting operation.
.RE

.SH CONTEXT
.sp
.LP
The \fBddi_intr_get_pri()\fR and \fBddi_intr_set_pri()\fR functions can be
called from kernel non-interrupt context.
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.sp
.LP
\fBattributes\fR(5), \fBddi_intr_alloc\fR(9F), \fBddi_intr_enable\fR(9F),
\fBmutex_init\fR(9F), \fBrw_init\fR(9F)
.sp
.LP
\fIWriting Device Drivers\fR
.SH NOTES
.sp
.LP
The priority returned from \fBddi_intr_get_pri()\fR should be typecast by
calling the \fBDDI_INTR_PRI\fR macro before passing it onto
\fBmutex_init\fR(9F).
.sp
.LP
Consumers of these interfaces should verify that the return value is not equal
to \fBDDI_SUCCESS\fR. Incomplete checking for failure codes could result in
inconsistent behavior among platforms.