NAME

vme_interrupt_attach - Associates the current process with a VME interrupt level.

SYNOPSIS

int vme_interrupt_attach ( vme_bus_handle_t bus_handle, vme_interrupt_handle_t * interrupt_handle, int level, int vector, int flags, void * data )

PARAMETERS

vme_bus_handle_t bus_handle

Handle allocated by vme_init.

vme_interrupt_handle_t * interrupt_handle

Pointer to the interrupt handle to allocate.

int level

VMEbus interrupt level. Possible values for the Tundra Universe II device are:

- VME_INTERRUPT_VOWN
- VME_INTERRUPT_VIRQ1
- VME_INTERRUPT_VIRQ2
- VME_INTERRUPT_VIRQ3
- VME_INTERRUPT_VIRQ4
- VME_INTERRUPT_VIRQ5
- VME_INTERRUPT_VIRQ6
- VME_INTERRUPT_VIRQ7
- VME_INTERRUPT_DMA
- VME_INTERRUPT_LERR
- VME_INTERRUPT_BERR
- VME_INTERRUPT_SW_IACK
- VME_INTERRUPT_SW_INT
- VME_INTERRUPT_SYSFAIL
- VME_INTERRUPT_ACFAIL
- VME_INTERRUPT_MBOX0
- VME_INTERRUPT_MBOX1
- VME_INTERRUPT_MBOX2
- VME_INTERRUPT_MBOX3
- VME_INTERRUPT_LM0
- VME_INTERRUPT_LM1
- VME_INTERRUPT_LM2
- VME_INTERRUPT_LM3
int vector

Interrupt vector. Possible values are 0 to 255 for VIRQ[1-7], or 0 for all other interrupt levels.

int flags

Interrupt flags. Indicates the type of interrupt notification. Possible values are:

- VME_INTERRUPT_BLOCKING
- VME_INTERRUPT_SIGEVENT
- VME_INTERRUPT_RESERVE
void * data

For VME_INTERRUPT_SIGEVENT, a sigevent structure describing the signal to return is. For VME_INTERRUPT_BLOCKING, a value is returned.

DESCRIPTION

Associates the current process with a VME interrupt level.

For certain interrupts, a data value is returned by either the reply parameter for blocking interrupts (VME_INTERRUPT_BLOCKING), or by the signal value structure member if POSIX real-time signals are used (VME_INTERRUPT_SIGEVENT). In the case of VIRQ1-7, the value is the interrupt vector; in the case of a DMA interrupt, the value is the status of the DGCS register; in the case of BERR, the value is the address of the bus error; and in the case of a mailbox interrupt, the value is the mailbox data.

Reserved interrupts (VME_INTERRUPT_RESERVE) are a special case with kernel modules only. This flag informs the VME driver that another module will process interrupts of the given VMEbus interrupt level.

RETURNS

0 on success, or -1 on failure.

SEE ALSO

vme_interrupt_generate(3), vme_interrupt_release(3)