pig(7)
NAME
pig − programmable interrupt generator device
DESCRIPTION
The pig device is a software interface provided for the programmable interrupt generator. When an interrupt is generated, the interrupt generator causes a low-high-low transition on the interrupt output. The pulse width of the generated interrupt is a minimum of 2.0 microseconds.
Configuration
The programmable interrupt generator is contained on an optional board that plugs into the HVME bus. A maximum of one programmable interrupt board may be plugged into a system. Each interrupt generator contains 64 interrupts for a maximum of 64 interrupts per system.
Special Files, Minor Device Numbers
Pig device special file names have the form /dev/rpig/pig#. The character "#" stands for the pig number (00-63).
User Interface
A pig is controlled by open(2), close(2), and ioctl(2) system calls.
The open(2) call assigns a file descriptor to one programmable interrupt. One device file (e.g. /dev/rpig/pig00) exists for each programmable interrupt. A close(2) call frees the file descriptor. The ioctl(2) call generates an interrupt. In addition, all ioctl(2) calls use the constants defined in <sys/pig.h>. Note that this device does not support the read(2) and write(2) system calls.
Ioctl Calls
All the following ioctl(2) calls require the user to have read and write access to the device.
The following ioctl(2) calls have the form:
#include <sys/types.h>
#include <sys/pig.h>
ioctl(fildes, command, 0)
int fildes, command;
The commands are:
PIG_PULSEForce a low-high-low transition on the interrupt output.
PIG_LOWForce the interrupt output to a low state. This command is only valid for the (H)VME interrupt generator.
PIG_HIGHForce the interrupt output to a high state. This command is only valid for the (H)VME interrupt generator.
The remaining ioctl(2) calls have the following form:
#include <sys/types.h>
#include <sys/pig.h>
ioctl(fildes, command, arg)
int fildes, command;
int ∗arg;
The commands are:
PIG_VMEIf this programmable interrupt is configured on an (H)VME interrupt generator, return a 1 in the address pointed to by arg; otherwise, return a 0.
FILES
/dev/rpig/pig[00-63] pig raw (character) special files
ERROR CODES
open or ioctl will fail if one or more of the following are true:
[ENODEV] The programmable interrupt does not exist.
[ENXIO] The programmable interrupt is not properly configured.
[EBADF] Fildes is not a valid open file descriptor.
[EINVAL] Request or argument is not valid.
SEE ALSO
ioctl(2), open(2), close(2), eti(7)
BUGS
CX/UX Administrator’s Reference