Interrupt Service Procedures
K
A
DAK
65
4.7 Special InterruptsNonconforming Interrupts
In some systems there may be devices which generate interrupts requiring no
communication or synchronization with any task in the system. For example, a high-
speed scanner can interrupt the processor whenever new data readings are available. Th e
ISP reads the new data and stores it in memory for subsequent use by any module
requiring the information. These modules always use the most recently available value as
seen in memory. Interrupts such as this do not need to use AMX services. The ISP
simply saves the registers it requires for its own use, processes the interrupting device,
restores the registers and immediately returns to the point of interruption using an IRET
instruction.
Since ISPs of this type use the stack in effect at the time of the interrupt, care must be
taken to assure that ALL stack sizes, including the AMX Interrupt Stack and Kern el
Stack, are increased to meet the needs of the special ISPs.
ISPs of this type are called nonconforming ISPs. You must arrange in hardware that all
such nonconforming interrupt sources are of higher priority than all conforming AMX
Interrupt Service Procedures. If this is not possible, the private Interrupt Service
Procedure must execute with interrupts disabled. Note that the AMX clock ISP (see
Chapter 5.2) is considered to be a conforming ISP.
Occasional Task Interaction
In some applications, it may be desirable to bypass AMX for all but certain critical
interrupts. For example, in a communication system, normal receive interrupts simply
insert the received character into an already available input buffer. Transmit interrupts
simply transmit the next available character from an output buffer. These interrupts can
be serviced very quickly in a nonconforming ISP, bypassing AMX entirely.
However, when the receiver finally has a complete message or when the transmit buffer
goes empty, the device service procedure must send a message to a particular task to
inform it that a significant event has occurred on the communication line.
The device service procedure must suddenly become a conforming AMX Interrupt
Service Procedure. It can do this by restoring all saved registers and calling a conforming
ISP root. The ISP root informs AMX that the interrupt has occurred and calls the
device's Interrupt Handler which can then send its message to the task.
Note that if interrupts of this type are employed, all AMX and task stacks must meet the
requirements of the nonconforming device ISP.