56
K
A
DAK
Interrupt Service Procedures
4.3 Nested Interrupts
AMX supports nested interrupts. The AMX Interrupt Supervisor maintains a private
nesting level indicator. AMX must be informed of the start (AAINT) and end (AAINX) of
each interrupt.
When AMX sees that a task has been interrupted, it switches to a predefined Interrupt
Stack. If AMX detects that the interrupt has occurred during execution of a device
Interrupt Service Procedure, then no stack switching occurs. The interrupted ISP is
suspended and the new ISP is started.
When an ISP ends, AMX takes action based on the state of its nesting indicator. When a
nested interrupt ISP is completed, AMX returns to the interrupted ISP. When the last
interrupt ISP (corresponding to the first task interrupt) is completed, AMX prepares to
return to the interrupted task. If, as a consequence of interrupt service, a significant event
has been declared, AMX suspends the interrupted task and goes to the AMX Task
Scheduler to find the highest priority task which is ready to execute.
Since the AMX Interrupt Stack is used for nesting interrupts, the stack size must be large
enough to support the worst case combination of nested ISPs. Each nested interrupt
requires that the Interrupt Stack be increased to meet the needs of the additi onal nested
ISP.
Warning
You must not permit a conforming ISP to interrupt a
nonconforming ISP.
The AMX clock ISP is a conforming ISP.