DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

udi_intr_attach_cb_t(3udi)


Control block for interrupt registration operations

SYNOPSIS

#include <udi.h>

typedef struct {

	udi_cb_t gcb;

	udi_index_t interrupt_idx;

	udi_ubit8_t min_event_pend;

	udi_pio_handle_t preprocessing_handle;

} udi_intr_attach_cb_t;
 
/* Bridge Attach Control Block Group Number */
 
#define  UDI_BUS_INTR_ATTACH_CB_NUM				2
 

MEMBERS gcb is a generic control block header, which includes a pointer to the scratch space associated with this control block. The driver may use the scratch space while it owns the control block, but the values are not guaranteed to persist across channel operations.

interrupt_idx is used to select one of possibly several interrupt sources from the interrupt handler's device that are managed by a particular interrupt dispatcher. Zero indicates the first interrupt source for the device, one indicates the second source, etc. The dispatcher driver will have previously associated the handler's device properties with its channel context during the initial binding sequence.

The definition of interrupt_idx is bus and device dependent, and must be determined by the driver via the bus_type instance attribute (see Chapter 15, "Instance Attribute Management" in the UDI Core Specification) in conjunction with the corresponding UDI bus bindings (see "Section 3: Bus Bindings"). For example, if bus_type is "pci" then the settings would be based on the definitions in the UDI PCI Bus Binding Specification.

min_event_pend is the minimum number of interrupt event control blocks that must be supplied to the dispatcher by the handler (via udi_intr_event_rdy operations) before the dispatcher will invoke the preprocessing_handle trans list at start label 0 to enable interrupts from the device. Once invoked at label 0, all subsequent PIO preprocessing will be invoked at label 1 until only a single interrupt event control block remains, at which point label 2 will be used to invoke PIO preprocessing. If no interrupt event control blocks remain, label 3 will be used whenever an interrupt causes the PIO preprocessing to be invoked. Interrupt processing will not exit the "label 3" state until at least min_event_pend control blocks are supplied, at which time label 0 will be invoked and the cycle will repeat. If the number of control blocks available falls below min_event_pend, no action will be taken (PIO processing will continue to be invoked at label 1) until only one control block remains; if the number of control blocks moves back above min_event_pend without ever reaching the lower limit of 1 control block, no specific action will be taken and PIO processing will continue to be invoked at label 1 as normal.

The value for min_event_pend must be at least 2.

max_event_pend is the maximum number of interrupt events the device and driver can have pending at one time. This is a hint to the dispatcher, so it can determine how many event control blocks to allocate for maximum concurrency.

preprocessing_handle is an optional PIO handle to be used to preprocess interrupts. If not null, the interrupt dispatcher will execute the associated PIO transaction list before delivering the interrupt to the interrupt handler. If null, the handler must run in an interrupt region.

DESCRIPTION The interrupt attach control block is used between the interrupt handler and the interrupt dispatcher to attach interrupt handler channels (i.e., register an interrupt handler for a particular interrupt source).

This control block must be declared by specifying the control block index value UDI_BUS_INTR_ATTACH_CB_NUM in a udi_cb_init_t in the driver's udi_init_info.

The bus device driver obtains the udi_intr_attach_cb_t structure to use with the udi_intr_attach_req by calling udi_cb_alloc with a cb_idx that has been associated with UDI_BUS_INTR_ATTACH_CB_NUM.

REFERENCES udi_intr_attach_req, udi_intr_attach_ack, udi_init_info, udi_cb_init_t, udi_cb_alloc


UDI Physical I/O Specification Contents