next up previous
Next: Interrupts and Linux (Interrupt Up: Interrupts Previous: Interrupt types

How to program and use interrupts

Interrupts are forwarded to the user program by means of the select() system call or by delivering the SIGUSR1 signal to the user program. The select() call returns if an interrupt occurred or if a predefined time interval is over. Afterwards the users program can query the interrupts with the function ArwvmeGetNextPendingInt().

 
    int ArwvmeSelect(int fd, struct timeval *);
Supports the kernel with the timeout for this process and schedules this calling process for the selection, if there is no pending interrupt in the queue, or an interrupt waiting on the bus.
 
    int ArwvmeEnableInterrupt(int fd); (deprecated)
Globally enables VMEbus interrupt notification (i.e. installs the irq handler). This function is a dummy and only available for compatibilty to the ATVME library. The irq is always enabled, if a process is registered in the driver.
 
    ArwvmeDisableInterrupt(int fd); (deprecated)
Removes the irq handler from the kernel and disables interrupts. This function is also a dummy, the irq is disabled while no process is registered in the driver.

 
    int ArwvmePostInterrupt(int fd, ArwvmeAckType ack_type, 
             unsigned int rora_addr, int int_vector, 
             unsigned int acc_mask);
allows to specify the interrupt acknowledge type. In the case of RORA there are the alternatives ArwvmeRoraByHandler and ArwvmeRoraByUser. ArwvmeRoraByHandler means the user supports the handler with a register address linked to an interrupt vector. On RORA interrupt the handler will access this register which ends the acknowledge cycle. On ArwvmeRoraByUser it's up to the user to access the register (which is also necessary in cases of more complicated RORA protocols), well knowing, that interrupt generation is blocked 'til user acknowledges.

 
    int ArwvmeRemoveInterrupt(int fd, int int_vector);
removes the notification for interrupt vector int_vector.

 
    ArwvmeIntAck *ArwvmeGetNextPendingInt(int fd);
gets the next interrupt from the list of pending interrupts. The returned IntAckStruct contains the interrupt vector, timelabel, the acknowledge type and the RORA register (if supplied). The user must free this space.

 
    int ArwvmeSignal(int fd, void (*sig_handler)(int));
attaches the signal SIGUSR1 to the caller. If an interrupt occures, the user will be informed via SIGUSR1.
next up previous
Next: Interrupts and Linux (Interrupt Up: Interrupts Previous: Interrupt types


Fri Jul 2 08:09:45 MEST 1999