'\" te
.\" Copyright (c) 2005, 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_PENDING 9F "Apr 7, 2005"
.SH NAME
ddi_intr_get_pending \- get pending bit for a given interrupt
.SH SYNOPSIS
.nf
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>

\fBint\fR \fBddi_intr_get_pending\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBint *\fR\fIpendingp\fR);
.fi

.SH INTERFACE LEVEL
illumos DDI specific (illumos DDI).
.SH PARAMETERS
.ne 2
.na
\fB\fIh\fR\fR
.ad
.RS 12n
DDI interrupt handle
.RE

.sp
.ne 2
.na
\fB\fIpendingp\fR\fR
.ad
.RS 12n
Pointer to the pending capability returned for this handle
.RE

.SH DESCRIPTION
The \fBddi_intr_get_pending()\fR function returns non-zero as the integer
pointed to by the \fIpendingp\fR argument if a corresponding interrupt is
pending. The corresponding interrupt handle \fIh\fR must already be allocated.
The call succeeds if the device or host bridge supports the ability to read the
interrupt pending bits of its interrupts. The driver should use
\fBddi_intr_get_cap()\fR function to see if the \fBDDI_INTR_FLAG_PENDING\fR
flag is returned to indicate that interrupts support interrupt pending bits.
.sp
.LP
If the \fBDDI_INTR_FLAG_PENDING\fR capability is not supported,
\fBddi_intr_get_pending()\fR returns \fBDDI_ENOTSUP\fR and zero in
\fIpendingp\fR.
.SH RETURN VALUES
The \fBddi_intr_get_pending()\fR function returns:
.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
The \fBddi_intr_get_pending()\fR function can be called from either user or
kernel non-interrupt context.
.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

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

.SH SEE ALSO
.BR attributes (7),
.BR ddi_intr_block_disable (9F),
.BR ddi_intr_block_enable (9F),
.BR ddi_intr_clr_mask (9F),
.BR ddi_intr_disable (9F),
.BR ddi_intr_enable (9F),
.BR ddi_intr_set_mask (9F)
.sp
.LP
\fIWriting Device Drivers\fR
.SH NOTES
Any consumer of this interface 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.