Skip Navigation Links | |
Exit Print View | |
![]() |
man pages section 9: DDI and DKI Kernel Functions Oracle Solaris 10 1/13 Information Library |
csx_AccessConfigurationRegister(9F)
csx_Parse_CISTPL_BYTEORDER(9F)
csx_Parse_CISTPL_CFTABLE_ENTRY(9F)
csx_Parse_CISTPL_DEVICEGEO(9F)
csx_Parse_CISTPL_DEVICEGEO_A(9F)
csx_Parse_CISTPL_DEVICE_OA(9F)
csx_Parse_CISTPL_DEVICE_OC(9F)
csx_Parse_CISTPL_LINKTARGET(9F)
csx_Parse_CISTPL_LONGLINK_A(9F)
csx_Parse_CISTPL_LONGLINK_C(9F)
csx_Parse_CISTPL_LONGLINK_MFC(9F)
ddi_get_soft_iblock_cookie(9F)
ddi_intr_get_supported_types(9F)
ddi_prop_lookup_byte_array(9F)
ddi_prop_lookup_int64_array(9F)
ddi_prop_lookup_string_array(9F)
ddi_prop_update_byte_array(9F)
ddi_prop_update_int64_array(9F)
ddi_prop_update_string_array(9F)
ldi_prop_lookup_byte_array(9F)
ldi_prop_lookup_int64_array(9F)
ldi_prop_lookup_string_array(9F)
mac_prop_info_set_default_link_flowctrl(9F)
mac_prop_info_set_default_str(9F)
mac_prop_info_set_default_uint8(9F)
mac_prop_info_set_range_uint32(9F)
net_event_notify_unregister(9F)
net_instance_notify_register(9F)
net_instance_notify_unregister(9F)
net_instance_protocol_unregister(9F)
net_protocol_notify_register(9F)
nvlist_lookup_boolean_array(9F)
nvlist_lookup_boolean_value(9F)
nvlist_lookup_nvlist_array(9F)
nvlist_lookup_string_array(9F)
nvlist_lookup_uint16_array(9F)
nvlist_lookup_uint32_array(9F)
nvlist_lookup_uint64_array(9F)
nvpair_value_boolean_array(9F)
pci_plist_lookup_int16_array(9F)
pci_plist_lookup_int32_array(9F)
pci_plist_lookup_int64_array(9F)
pci_plist_lookup_int8_array(9F)
pci_plist_lookup_string_array(9F)
pci_plist_lookup_uint16_array(9F)
pci_plist_lookup_uint32_array(9F)
pci_plist_lookup_uint64_array(9F)
pci_plist_lookup_uint8_array(9F)
scsi_get_device_type_scsi_options(9F)
scsi_sense_cmdspecific_uint64(9F)
usb_get_current_frame_number(9F)
usb_get_max_pkts_per_isoc_request(9F)
usb_pipe_get_max_bulk_transfer_size(9F)
usb_pipe_stop_intr_polling(9F)
usb_pipe_stop_isoc_polling(9F)
- allocate or free interrupts for a given interrupt type
#include <sys/types.h> #include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> int ddi_intr_alloc(dev_info_t *dip, ddi_intr_handle_t *h_array, int type, int inum, int count, int *actualp, int behavior);
int ddi_intr_free(ddi_intr_handle_t h);
Solaris DDI specific (Solaris DDI).
ddi_intr_alloc()
Pointer to the dev_info structure
Pointer to an array of DDI interrupt handles
Interrupt type
Interrupt number
Number of interrupts requested. The count should not exceed the total number of interrupts supported by the device, as returned by a call to ddi_intr_get_nintrs(9F).
Pointer to the number of interrupts actually allocated
Flag to determine the allocation algorithm
ddi_intr_free()
DDI interrupt handle
The ddi_intr_alloc() function allocates interrupts of the interrupt type given by the type argument beginning at the interrupt number inum. If ddi_intr_alloc() allocates any interrupts, it returns the actual number of interrupts allocated in the integer pointed to by the actualp argument and returns the number of interrupt handles in the interrupt handle array pointed to by the h_array argument.
Specific interrupts are always specified by the combination of interrupt type and inum. For legacy devices, inum refers to the nth interrupt, typically as defined by the devices interrupts property. For PCI fixed interrupts, inum refers to the interrupt number. The inum is the relative interrupt vector number, from 0 to 31 for MSI, from 0 to 2047 for MSI-X. The first interrupt vector is 0. The last relative vector is 31 for MSI or 2047 for MSI-X.
The h_array must be pre-allocated by the caller as a count sized array of ddi_intr_handle_t's.
If MSI interrupts are being allocated, the count argument passed should be a number between 1 and 32, specified as a power of two. If count is not specified as a power of two, the error DDI_EINVAL is returned.
The behavior flag controls the interrupt allocation algorithm. It takes one of two input values: DDI_INTR_ALLOC_NORMAL or DDI_INTR_ALLOC_STRICT. If the count value used is greater than NINTRs, then the call fails with DDI_EINVAL unconditionally. When set to DDI_INTR_ALLOC_STRICT, the call succeeds if and only if count interrupts are allocated. Otherwise, the call fails, and the number of available interrupts is returned in actualp. When set to DDI_INTR_ALLOC_NORMAL, the call succeeds if at least one interrupt is allocated, and the number of allocated interrupts is returned in actualp.
The handle for each allocated interrupt, if any, is returned in the array of handles given by the h_array argument.
The ddi_intr_free() function releases the system resources and interrupt vectors associated with the ddi_intr_handle_t h, including any resources associated with the handle h itself. Once freed, the handle h should not be used in any further calls.
The ddi_intr_free() function should be called once for each handle in the handle array.
The ddi_intr_alloc() and ddi_intr_free() functions return:
On success.
Not enough interrupt resources.
On encountering invalid input parameters.
On failure to find the interrupt.
On any implementation specific failure.
The ddi_intr_alloc() and ddi_intr_free() functions can be called from kernel non-interrupt context.
See attributes(5) for descriptions of the following attributes:
|
attributes(5), ddi_intr_add_handler(9F), ddi_intr_block_enable(9F), ddi_intr_disable(9F), ddi_intr_enable(9F), ddi_intr_get_cap(9F), ddi_intr_get_nintrs(9F), ddi_intr_get_pri(9F), ddi_intr_get_supported_types(9F), ddi_intr_remove_handler(9F)
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.
If a device driver that uses MSI and MSI-X interrupts resets the device, the device might reset its configuration space modifications. Such a reset could cause a device driver to lose any MSI and MSI-X interrupt usage settings that have been applied.