|DDI_INTR_GET_NINTRS(9F)||Kernel Functions for Drivers||DDI_INTR_GET_NINTRS(9F)|
#include <sys/types.h> #include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> int ddi_intr_get_nintrs(dev_info_t *dip, int type, int *nintrsp);
int ddi_intr_get_navail(dev_info_t *dip, int type, int *navailp);
If the hardware device is not found to support any interrupts of the given type, the DDI_INTR_NOTFOUND failure is returned rather than a zero in nintrsp.
The ddi_intr_get_navail() function returns the number of interrupts of a given type that is available to a particular hardware device. On a successful return, the number of available interrupts is returned as an integer pointed to by navailp.
The hardware device may support more than one interrupt and can request that all interrupts be allocated. The host software can then use policy-based decisions to determine how many interrupts are made available to the device. Based on the determination, a value is returned that should be used to allocate interrupts with the ddi_intr_alloc() function.
The ddi_intr_get_supported_types(9F) function returns a list of valid supported types for the given hardware device. It must be called prior to calling either the ddi_intr_get_nintrs() or ddi_intr_get_navail().
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
Writing Device Drivers
On x86 platforms, the number of interrupts returned by the ddi_intr_get_navail() function might need to be further reduced by the number of interrupts available for each interrupt priority on the system. In that case, drivers should use different priorities for some of the interrupts.
Consumers of these interfaces should verify that the return value is not equal to DDI_SUCCESS. Incomplete checking for failure codes could result in inconsistent behavior among platforms.
|December 13, 2013||OmniOS|