Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ddi_intr_set_mask.9f
blob035b5ca768ef83bce6e3687943923bf5b00a94ba
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_SET_MASK 9F "Apr 05, 2006"
7 .SH NAME
8 ddi_intr_set_mask, ddi_intr_clr_mask \- set or clear mask for 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_set_mask\fR(\fBddi_intr_handle_t\fR \fIh\fR);
18 .fi
20 .LP
21 .nf
22 \fBint\fR \fBddi_intr_clr_mask\fR(\fBddi_intr_handle_t\fR \fIh\fR);
23 .fi
25 .SH INTERFACE LEVEL
26 .sp
27 .LP
28 Solaris DDI specific (Solaris DDI).
29 .SH PARAMETERS
30 .sp
31 .ne 2
32 .na
33 \fB\fIh\fR\fR
34 .ad
35 .RS 5n
36 DDI interrupt handle
37 .RE
39 .SH DESCRIPTION
40 .sp
41 .LP
42 The \fBddi_intr_set_mask()\fR function masks the given interrupt pointed to by
43 the device's interrupt handle \fIh\fR if the device or host bridge supports the
44 masking operation. The \fBddi_intr_get_cap()\fR function returns the \fBRO\fR
45 flag \fBDDI_INTR_FLAG_MASKABLE\fR if the device or host bridge supports
46 interrupt mask bits for the given interrupt type. In flight interrupts can
47 still be taken and delivered to the driver.
48 .sp
49 .LP
50 The \fBddi_intr_clr_mask()\fR function unmasks the given interrupt pointed by
51 the device's interrupt handle \fIh\fR if the device or host bridge supports the
52 masking operation.
53 .sp
54 .LP
55 The \fBddi_intr_set_mask()\fR and \fBddi_intr_clr_mask()\fR functions should be
56 called only if an interrupt is enabled. Otherwise the framework will return
57 \fBDDI_EINVAL\fR to such calls.
58 .sp
59 .LP
60 The mask cannot be cleared directly if the OS implementation has also
61 temporarily masked the interrupt. A call to \fBddi_intr_clr_mask()\fR must be
62 preceded by a call to \fBddi_intr_set_mask()\fR. It is not necessary to call
63 \fBddi_intr_clr_mask()\fR when adding and enabling the interrupt.
64 .SH RETURN VALUES
65 .sp
66 .LP
67 The \fBddi_intr_set_mask()\fR and \fBddi_intr_clr_mask()\fR functions return:
68 .sp
69 .ne 2
70 .na
71 \fB\fBDDI_SUCCESS\fR\fR
72 .ad
73 .RS 15n
74 On success.
75 .RE
77 .sp
78 .ne 2
79 .na
80 \fB\fBDDI_EINVAL\fR\fR
81 .ad
82 .RS 15n
83 On encountering invalid input parameters or when an interrupt is not enabled.
84 .RE
86 .sp
87 .ne 2
88 .na
89 \fB\fBDDI_FAILURE\fR\fR
90 .ad
91 .RS 15n
92 On any implementation specific failure.
93 .RE
95 .sp
96 .ne 2
97 .na
98 \fB\fBDDI_ENOTSUP\fR\fR
99 .ad
100 .RS 15n
101 On device not supporting operation.
104 .SH CONTEXT
107 The \fBddi_intr_set_mask()\fR and \fBddi_intr_clr_mask()\fR functions can be
108 called from any context.
109 .SH ATTRIBUTES
112 See \fBattributes\fR(5) for descriptions of the following attributes:
117 box;
118 c | c
119 l | l .
120 ATTRIBUTE TYPE  ATTRIBUTE VALUE
122 Interface Stability     Committed
125 .SH SEE ALSO
128 \fBattributes\fR(5), \fBddi_intr_block_disable\fR(9F),
129 \fBddi_intr_block_enable\fR(9F), \fBddi_intr_disable\fR(9F),
130 \fBddi_intr_enable\fR(9F), \fBddi_intr_get_pending\fR(9F)
133 \fIWriting Device Drivers\fR
134 .SH NOTES
137 Consumers of these interfaces should verify that the return value is not equal
138 to \fBDDI_SUCCESS\fR. Incomplete checking for failure codes could result in
139 inconsistent behavior among platforms.