udi_intr_event_cb_t(3udi)


Control block for interrupt event ops

SYNOPSIS

#include <udi.h>

typedef struct {

	udi_cb_t gcb;

	udi_buf_t *event_buf;

	udi_ubit16_t intr_result;

} udi_intr_event_cb_t;
 
/* Flag values for interrupt handling */
 
#define  UDI_INTR_UNCLAIMED				(1U<<0)
 
#define  UDI_INTR_NO_EVENT				(1U<<1)
 
/* Bus Interrupt Event Control Block Group Number */
 
#define UDI_BUS_INTR_EVENT_CB_NUM
4
 

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.

event_buf This buffer (if any) must be preallocated by the handler before being passed to the dispatcher and must contain enough valid bytes to handle the largest PIO trans list requirements; the dispatcher's PIO trans operations cannot extend the size of this buffer.

intr_result is, in the non-preprocessing case, set by the interrupt handler before invoking udi_intr_event_rdy, to indicate whether or not its device asserted the interrupt. In the preprocessing case, intr_result is set by the dispatcher to the result value from the udi_pio_trans call used to preprocess the interrupt, and passed to the handler via the udi_intr_event_ind channel operation.

UDI_INTR_UNCLAIMED is set by the non-preprocessing handler in the intr_result field for the udi_intr_event_rdy operation to indicate that the corresponding device did not generate the interrupt and that the dispatcher should proceed to process any other shared interrupts for this interrupt line. In the preprocessing case, this status is indicated by the preprocessing PIO trans list by setting this bit in the first byte of the control block's scratch space; the dispatcher will not pass the interrupt event indication to the handler and will check other devices as in the non-preprocessing case.

UDI_INTR_NO_EVENT is not used for interrupts occurring in the non-preprocessing case, but may be set in the first byte of the control block's scratch space by the PIO trans list in the preprocessing case to indicate that the PIO trans list handled the interrupt in its entirety and that no interrupt event should be delivered to the handler.

The UDI_INTR_NO_EVENT value may be set for newly allocated interrupt event control blocks allocated by the handler and passed to the dispatcher via the udi_intr_event_rdy operation.

The intr_result value returned in the udi_intr_event_rdy call for the preprocessing case is ignored by the dispatcher.

The dispatcher will zero the first byte of the control block scratch space before initiating the udi_pio_trans on the preprocessing PIO trans list in the preprocessing case; the PIO trans list does not need to modify the byte unless specific bits must be set. The remaining bytes of scratch space are unspecified and must not be used by the preprocessing trans list.

Drivers that cannot tell whether or not their device actually asserted an interrupt, or whose device's interrupts are for some other reason non-sharable, must include a "nonsharable_interrupt" declaration in their static driver properties file (see Section 1.4, "Extensions to Static Driver Properties"), and must not use UDI_INTR_UNCLAIMED.

DESCRIPTION The interrupt event control block is used between the interrupt handler and the interrupt dispatcher to deliver and acknowledge interrupt events.

If the interrupt event was pre-processed (as indicated by the initial value of intr_result passed to udi_intr_event_ind), the event_buf will contain any data filled in during the first-level handler by using the device driver's pre-registered PIO transaction list. (See preprocessing_handle in udi_intr_attach_cb_t.)

Otherwise, event_buf will contain bus-type specific event information, as defined in the bus binding specification for the type of bus to which the device is attached. If the size of the event information is greater than the valid buffer size, only the information that fits in the pre-validated buffer region will be returned. If the event information size is less than the valid buffer size, the remaining bytes will be part of the buffer's valid data range, but the contents are unspecified.

If a driver supports a device which might make use of interrupt event info, it must first determine what type of bus the device is plugged into, by looking at its driver instance attributes. It may then interpret the event info using the corresponding bus binding. See Chapter 6, "Introduction to Bus Bindings", for information on the format of interrupt event info.

REFERENCES udi_intr_attach_cb_t


UDI Physical I/O Specification Contents