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"
8 ddi_intr_set_mask, ddi_intr_clr_mask \- set or clear mask for a given interrupt
12 #include <sys/types.h>
15 #include <sys/sunddi.h>
17 \fBint\fR \fBddi_intr_set_mask\fR(\fBddi_intr_handle_t\fR \fIh\fR);
22 \fBint\fR \fBddi_intr_clr_mask\fR(\fBddi_intr_handle_t\fR \fIh\fR);
28 Solaris DDI specific (Solaris DDI).
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.
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
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.
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.
67 The \fBddi_intr_set_mask()\fR and \fBddi_intr_clr_mask()\fR functions return:
71 \fB\fBDDI_SUCCESS\fR\fR
80 \fB\fBDDI_EINVAL\fR\fR
83 On encountering invalid input parameters or when an interrupt is not enabled.
89 \fB\fBDDI_FAILURE\fR\fR
92 On any implementation specific failure.
98 \fB\fBDDI_ENOTSUP\fR\fR
101 On device not supporting operation.
107 The \fBddi_intr_set_mask()\fR and \fBddi_intr_clr_mask()\fR functions can be
108 called from any context.
112 See \fBattributes\fR(5) for descriptions of the following attributes:
120 ATTRIBUTE TYPE ATTRIBUTE VALUE
122 Interface Stability Committed
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
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.