IONINTR(3)
HP-UX
NAME
ionintr − installs an interrupt handler
SYNOPSIS
#include <sicl.h>
int ionintr(INST id, void (*proc)());
void proc(INST id, long reason, long sec);
DESCRIPTION
Ionintr installs proc as the interrupt handler for the session specified by the id parameter. Proc is called any time an enabled interrupt arrives from an enabled session. There is only one interrupt handler for a given session; multiple calls to ionintr with the same session INST id overwrites the current effective interrupt handler.
One proc can be the interrupt handler for more than one session. The id parameter passed to proc is set to the INST id of the session that generated the interrupt, allowing the handler to determine the session for which it is executing.
If a process has two or more sessions that refer to the same address, the interrupt handler for each id is called.
Multiple interrupts generate multiple calls to the interrupt handler.
To disable the interrupt handler for a session, pass 0 in the proc parameter.
Removing the interrupt handler and reinstalling it does not effect the current state of enabled interrupts. By default, there is no interrupt handler and all interrupt conditions are disabled.
The reason parameter passed to proc specifies the interrupt that occurred. The sec parameter passed to proc is undefined unless specifcally defined below.
HP-IB Interrupts
The possible values for reason when id refers to an interface session are:
I_INTR_INTFACT
This controller became the active controller.
I_INTR_INTDACT
This controller performed a pass control.
VXI Interrupts
The possible values for reason when id refers to an interface
session are:
I_INTR_INTFACT
Normal operation has taken place (BNO has arrived).
I_INTR_INTDACT
Normal operation has been aborted (ANO or ENO has arrived).
I_INTR_TRIG A trigger has occurred. The sec parameter is a mask specifying which trigger(s) occurred using the same bitmask as the ixtrig(3) routine’s which parameter.
I_INTR_VXI_SYSRESET
A VXI SYSRESET occurred.
I_INTR_VXI_VME
A VME interrupt occurred from a VME device, or a VXI device that is not in our servant list.
I_INTR_VXI_UKNSIG
A VXI signal register was written to by a device that is not a servant of this controller. The sec parameter contains the value written into the signal register.
The possible values for reason when id refers to a device session are:
I_INTR_VXI_SIGNAL
A write to the VXI signal register was performed by the specified device (or a VME interrupt arrived from the VXI device that is in our servant list) and the signal was a user-defined (or undefined) event sent from the device corresponding to this session. The sec parameter contains the value written into the signal register.
RETURN VALUE
The ionintr command returns I_ERR_NOERROR on success, and a non-zero error code if an error occurred.
ERRORS
Some possible reasons for ionsrq failing are:
[I_ERR_BADID] Invalid INST id.
[I_ERR_PARAM] Invalid parameter.
WARNING
Note that this routine only installs the interrupt handler, it does not enable receiving interrupts for events.
Installing an interrupt handler and enabling interrupt conditions are two different events. An interrupt handler can be installed with no interrupt conditions enabled. Conversely, no interrupt handler may be installed, but interrupt conditions are enabled. Only when both an interrupt handler is installed and an interrupt condition is enabled will that interrupt be noticed and the interrupt handler executed.
AUTHOR
ionintr was developed by HP.
SEE ALSO
isetintr(3), ixtrig(3), igetonintr(3), igpibbusstatus(3), ivxibusstatus(3), igeterrno(3), igeterrstr(3)
Hewlett-Packard Company — May 05, 1994