Software Interrupt Initialization [ Interprocess Communication:Programmer's Guide ] MPE/iX 5.0 Documentation
Interprocess Communication:Programmer's Guide
Software Interrupt Initialization
As with most other files, the message file must be explicitly opened.
Software interrupts are usually used when reading from the file, but
there is nothing to stop a process from using them when writing. After
the call to HPFOPEN the application can perform normal WAIT or NOWAIT I/O
on the file.
When software interrupt operation begins, the process calls FCONTROL with
a controlcode of 48, passing the plabel of its interrupt handler.
FCONTROL with a controlcode of 48 returns the previous value of the
plabel. If that value is zero, this means that software interrupts were
not armed. If the program is using software interrupts on multiple
files, FCONTROL with a controlcode of 48 must be called for each file.
Each file can have its own interrupt handler, or more than one file can
share the same interrupt handler. When a message file has been opened
and FCONTROL has been called for the file with a controlcode of 48, that
message file is said to have software interrupts "armed."
At this point, the process can start the I/O (in this example, assume it
is FREAD). FCONTROL with a controlcode of 48 overrides the HPFOPEN NOWAIT
I/O option setting. Regardless of the setting of this bit, an IODONTWAIT
or IOWAIT is required to complete any I/O started after the FCONTROL,
controlcode 48, software interrupt. A call to IODONTWAIT or IOWAIT
before the interrupt occurs does not complete the I/O. A CCL is returned,
and FCHECK returns the message, FSERR 79--NO NOWAIT I/O PENDING FOR
SPECIFIED FILE.
NOTE If the FREAD intrinsic was called before FCONTROL with a
controlcode of 48 was invoked, it would have been handled as a
normal, non-software interrupt FREAD.
MPE XL starts out with software interrupts disabled. If the FREAD is
satisfied, the software interrupt is postponed until interrupts are
explicitly enabled. The process uses FINTSTATE at this point to enable
software interrupts for all "armed" files opened by this process. This
includes all files currently armed, and any yet to be armed by this
process, until FINTSTATE is called to disable interrupts. The call to
FINTSTATE can occur anywhere in this sequence, but the other intrinsic
calls should be made in the order given.
MPE/iX 5.0 Documentation