9022 loader.efi: module placement must check memory map
[unleashed.git] / share / man / man9f / ddi_intr_get_nintrs.9f
blob59d817ad4e2e16c74fa7755d6130b908cd75e8ba
1 '\" te
2 .\" Copyright (c) 2006, 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_NINTRS 9F "Dec 13, 2013"
7 .SH NAME
8 ddi_intr_get_nintrs, ddi_intr_get_navail \- return number of interrupts
9 supported or available for a given interrupt type
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/types.h>
14 #include <sys/conf.h>
15 #include <sys/ddi.h>
16 #include <sys/sunddi.h>
18 \fBint\fR \fBddi_intr_get_nintrs\fR(\fBdev_info_t *\fR\fIdip\fR, \fBint\fR \fItype\fR, \fBint *\fR\fInintrsp\fR);
19 .fi
21 .LP
22 .nf
23 \fBint\fR \fBddi_intr_get_navail\fR(\fBdev_info_t *\fR\fIdip\fR, \fBint\fR \fItype\fR, \fBint *\fR\fInavailp\fR);
24 .fi
26 .SH INTERFACE LEVEL
27 .sp
28 .LP
29 Solaris DDI specific (Solaris DDI).
30 .SH PARAMETERS
31 .sp
32 .LP
33 \fBddi_intr_get_nintrs()\fR
34 .sp
35 .ne 2
36 .na
37 \fB\fIdip\fR\fR
38 .ad
39 .RS 11n
40 Pointer to \fBdev_info\fR structure
41 .RE
43 .sp
44 .ne 2
45 .na
46 \fB\fItype\fR\fR
47 .ad
48 .RS 11n
49 Interrupt type
50 .RE
52 .sp
53 .ne 2
54 .na
55 \fB\fInintrsp\fR\fR
56 .ad
57 .RS 11n
58 Pointer to number of interrupts of the given type that are supported by the
59 system
60 .RE
62 .sp
63 .LP
64 \fBddi_intr_get_navail()\fR
65 .sp
66 .ne 2
67 .na
68 \fB\fIdip\fR\fR
69 .ad
70 .RS 11n
71 Pointer to \fBdev_info\fR structure
72 .RE
74 .sp
75 .ne 2
76 .na
77 \fB\fItype\fR\fR
78 .ad
79 .RS 11n
80 Interrupt type
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fInavailp\fR\fR
87 .ad
88 .RS 11n
89 Pointer to number of interrupts of the given type that are currently available
90 from the system
91 .RE
93 .SH DESCRIPTION
94 .sp
95 .LP
96 The \fBddi_intr_get_nintrs()\fR function returns the number of interrupts of
97 the given \fItype\fR supported by a particular hardware device. On a successful
98 return, the number of supported interrupts is returned as an integer pointed to
99 by the \fInintrsp\fR argument.
102 If the hardware device is not found to support any interrupts of the given
103 \fItype\fR, the \fBDDI_INTR_NOTFOUND\fR failure is returned rather than a zero
104 in \fInintrsp\fR.
107 The \fBddi_intr_get_navail()\fR function returns the number of interrupts of a
108 given \fItype\fR that is available to a particular hardware device. On a
109 successful return, the number of available interrupts is returned as an integer
110 pointed to by \fInavailp\fR.
113 The hardware device may support more than one interrupt and can request that
114 all interrupts be allocated. The host software can then use policy-based
115 decisions to determine how many interrupts are made available to the device.
116 Based on the determination, a value is returned that should be used to allocate
117 interrupts with the \fBddi_intr_alloc()\fR function.
120 The \fBddi_intr_get_supported_types\fR(9F) function returns a list of valid
121 supported types for the given hardware device. It must be called prior to
122 calling either the \fBddi_intr_get_nintrs()\fR or \fBddi_intr_get_navail()\fR.
123 .SH RETURN VALUES
126 The \fBddi_intr_get_nintrs()\fR and \fBddi_intr_get_navail()\fR functions
127 return:
129 .ne 2
131 \fB\fBDDI_SUCCESS\fR\fR
133 .RS 21n
134 On success.
138 .ne 2
140 \fB\fBDDI_EINVAL\fR\fR
142 .RS 21n
143 On encountering invalid input parameters.
147 .ne 2
149 \fB\fBDDI_INTR_NOTFOUND\fR\fR
151 .RS 21n
152 On not finding any interrupts for the given interrupt type.
156 .ne 2
158 \fB\fBDDI_FAILURE\fR\fR
160 .RS 21n
161 On any implementation specific failure.
164 .SH CONTEXT
167 The \fBddi_intr_get_nintrs()\fR and \fBddi_intr_get_navail()\fR functions can
168 be called from either user or kernel non-interrupt context.
169 .SH ATTRIBUTES
172 See \fBattributes\fR(5) for descriptions of the following attributes:
177 box;
178 c | c
179 l | l .
180 ATTRIBUTE TYPE  ATTRIBUTE VALUE
182 Interface Stability     Committed
185 .SH SEE ALSO
188 \fBattributes\fR(5), \fBddi_intr_alloc\fR(9F), \fBddi_intr_enable\fR(9F),
189 \fBddi_intr_get_supported_types\fR(9F)
192 \fIWriting Device Drivers\fR
193 .SH NOTES
196 The \fBddi_intr_get_nintrs()\fR and \fBddi_intr_get_navail()\fR functions can
197 be called at any time, even if the driver has added an interrupt handler for a
198 given interrupt specification.
201 On x86 platforms, the number of interrupts returned by the
202 \fBddi_intr_get_navail()\fR function might need to be further reduced by the
203 number of interrupts available for each interrupt priority on the system. In
204 that case, drivers should use different priorities for some of the interrupts.
207 Consumers of these interfaces should verify that the return value is not equal
208 to \fBDDI_SUCCESS\fR. Incomplete checking for failure codes could result in
209 inconsistent behavior among platforms.