
CHAPTER 8 INTERRUPT MANAGEMENT
User’s Manual U14833EJ2V0UM
94
8.5
Interrupt Service Routines
The routine that is activated when an interrupt is generated and performs processing in response to the interrupt
source is known as an interrupt service routine (ISR).
An interrupt service routine is described as a void type function with one VP_INT type argument. The extended
data exinf of the activated interrupt service routine is passed for this argument.
Example)
void int_serial(VP_INT exinf)
{
...
return;
}
8.5.1
Interrupt service routine ID number and interrupt number
As with other objects, an interrupt service routine has a unique ID number to identify its routine. However, with
interrupt service routines, it is also necessary to specify an interrupt number in order to identify the interrupt source
corresponding to a particular service routine.
The same interrupt number can be specified for more than one interrupt service routine.
8.5.2
Creating interrupt service routines
Interrupt service routines can be created either by issuing the service call (a)cre_isr, or by specifying the static API
CRE_ISR, which performs equivalent processing to acre_isr when the system is initialized.
If (a)cre_isr is issued, the kernel stores data such as the attribute and the interrupt number in the interrupt service
routine control block corresponding to the specified ID number and then initializes that block.
A queue for managing routines with the same interrupt number (interrupt table) is also controlled from the system
base table, where processing is performed to register control blocks in a queue corresponding to the number held by
the routine.
8.5.3
Deleting interrupt service routines
An interrupt service routine is deleted by issuing the del_isr service call.
When del_isr is issued, the kernel invalidates the specified interrupt servicing routine control block and deletes the
control block from the interrupt table controlled by the system base table.
After an interrupt service routine is deleted, an interrupt service routine with the same ID number as the deleted
routine can be newly created.
8.5.4
Activating interrupt service routines
An interrupt service routine is activated after an interrupt has been acknowledged and the source of the interrupt
determined. The interrupt service routine is activated by specifying the interrupt source number for ivsta_isr (ivsta_isr
does not cause a service call exception). If there is more than one routine for the same interrupt source number,
ivsta_isr causes all the interrupt service routines to be activated. The order of activation at this time is the order in
which the routines were created.