Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ io_on_inter(3I) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

pause(2)

sigpause(2)

io_interrupt_ctl(3I)

IO_ON_INTERRUPT(3I)  —  HP-UX

NAME

io_on_interrupt − device interrupt (fault) control

SYNOPSIS

int (*io_on_interrupt (eid, causevec, handler))()
int eid;
struct interrupt_struct *causevec;
int (*handler)();
 
handler (eid, causevec)
int eid;
struct interrupt_struct *causevec;

DESCRIPTION

Eid is an entity identifier of an open HP-IB raw bus, or GPIO device file, obtained from an open(2), dup(2), fcntl(2), or creat(2) call. 

Causevec is a pointer to a structure of the form:

struct interrupt_struct {

integer cause;
integer mask;

};

The interrupt_struct structure is defined in the file dvio.h. 

The cause parameter is a bit vector specifying which of the interrupt or fault events will cause the handler routine to be invoked.  The interrupt causes are often specific to the type of interface being considered.  As well, certain exception (error) conditions can be handled using the io_on_interrupt capability. Specifying a  zero valued cause vector effectively turns off the interrupt for that eid. 

The mask parameter is used when an HP-IB parallel poll interrupt is being defined. Mask is an integer that specifies which parallel poll response lines are of interest. Mask’s value is obtained from an 8-bit binary number, each bit of which corresponds to on of the eight lines. For example, if you want an interrupt handler invoked for a response on lines 2 or 6, the correct binary number is 01000100. This converts to a decimal equivalent of 68, which is the number you should assign to mask. 

Upon occurrence of an enabled interrupt condition on the specified eid, the receiving process is to execute the interrupt-handler function pointed to by handler. The Entity identifier eid and the interrupt condition cause will be returned as the first and second parameters respectively. 

When a interrupt that is to be caught occurs during a read, a write, an open, or an ioctl system call on a slow device (like a terminal; but not a file), during a pause system call, during a sigpause(2) system call, or during a wait system call that does not return immediately due to the existence of a previously stopped or zombie process, the interrupt handling function will be executed and then the interrupted system call will return a -1 to the calling process with errno set to EINTR. 

Interrupts handlers are not inherited across a fork(2). Eids for the same device file produced by dup(2) share the same handler. 

An interrupt for a given eid is implicitly disabled after the occurrence of the event. The interrupt condition may be re-enabled with io_interrupt_ctl(3I). 

Upon the occurrence of an event specified by cause, the receiving process is to execute the interrupt handler function pointed to by handler. When the handler returns the user process resumes at the point of execution left when the event occurred. 

Handler will be passed two parameters, the eid associated with the event, and a pointer to a causevec structure. The cause of the interrupt can be determined by the value returned in the cause field of the causevec structure. If the interrupt handler was invoked due to a parallel poll interrupt, then the mask field of the causevec  structure will contain the parallel poll response byte. 

HPIB INTERRUPTS

This section describes interrupt causes specific to an hpib device. For an hpib device the cause is a bit vector which is used as follows. To enable a given event, the appropriate bit (in cause), shown below, must be set to 1:
 

SRQ SRQ and active controller.
TLK Talker addressed.
LTN Listener addressed.
TCT Controller in charge.
IFC IFC has been asserted
REN Remote enable
DCL Device clear
GET Group execution trigger
PPOLL Parallel poll

 

GPIO INTERRUPTS

This section describes interrupt causes specific to a gpio device.  For a gpio device the cause is a bit vector which is used as follows. To enable a given event, the appropriate bit (in cause), shown below, must be set to 1:

 
EIR External interrupt
SIE0 Status line 0
SIE1 Status line 1
 

RETURN VALUE

Io_on_interrupt returns a pointer to the previous handler if the new handler is successfully installed, otherwise it returns a −1 and errno is set. 

ERRORS

Io_on_interrupt can fail for any of the following reasons:

­[EBADF] Eid does not refer to an open file. 

­[ENOTTY] Eid does not refer to a GPIO or a raw HP-IB device file. 

­[EFAULT] Handler points to an illegal address.  The reliable detection of this error will be implementation dependent. 

­[EFAULT] causevec points to an illegal address. [EFAULT] The reliable detection of this error will be implementation dependent. 

HARDWARE DEPENDENCIES

Series 200
The default timeout for the GPIO interface is 15 seconds.

Series 200, 300
Timeout resolution is 20 msec.

Series 800
For the HP 27112 GPIO interface, the EIR interrupt is not available.  For the HP 27114 GPIO interface, only the EIR interrupt is available. 

For the
HP 98622 GPIO interface, only the EIR interrupt is available.  For the HP 98265A/B HP-IB interface, the IPC and GET interrupts are not available. 

AUTHOR

Io_on_interrupt was developed by HP. 

SEE ALSO

pause(2), sigpause(2), io_interrupt_ctl(3I). 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026