52
K
A
DAK
Interrupt Service Procedures
If the Interrupt Handler requested AMX to initiate or resume execution of some task of
higher priority than the interrupted task, the AMX Interrupt Supervisor suspends the
interrupted task and marks it as ready to resume execution at the earliest opportunity.
The AMX Task Scheduler is then invoked to determine the highest priority task capable
of execution.
If interrupts nest, the Interrupt Supervisor defers its task switching checks until all of the
concurrent interrupts have been serviced.
In due course, AMX returns to the ISP root ready to resume execution at the point of
interruption. It is important to note that, because of task switching invoked by the AMX
Interrupt Supervisor, there may be a significant delay before AMX returns to the ISP root
and resumes execution of the interrupted task.
Note
Interrupt Handlers must only use AMX services which are
marked in Chapter 16 as
n ISP
The Interrupt Handler is free to use the following AMX service procedures to
communicate with tasks. If the affected task is of higher priority than the task which was
preempted by the interrupt, AMX will initiate a task switch when the interrupt service has
been completed.
ajsend AASEND Request a task to execute and send it a message
ajtrig AATRIG Request a task to execute with no message
ajwake AAWAKE Wake a task known to be waiting for this interrupt
ajsgnl AASGNL Signal a task
ajsmsig AASMSIG Signal to a semaphore
ajevsig AAEVSIG Signal an event
ajmxsnd AAMXSND Send a message to a message exchange
Interrupt Handlers are also free to use the following AMX buffer management and timing
facilities.
ajbget AABGET Get a buffer
ajbfre AABFRE Free a buffer
ajbau AABAU Add to buffer use count
ajtmwr AATMWR Start/stop an interval timer
ajtmrd AATMRD Read an interval timer
The full range of AMX circular list handling routines (see Chapter 11) can be used by
application Interrupt Handlers. These circular lists can be especially useful to provide
character buffering. For example, an input device Interrupt Handler can add characters to
the bottom of a circular list while a related task removes them from the top of the list.
The AMX List Manager services (see Chapter 12) can also be used by Interrupt Handlers.
Note that an Interrupt Handler should not manipulate keyed lists.