
CHAPTER 9 SYSTEM CONFIGURATION MANAGEMENT
User’s Manual U14833EJ2V0UM
100
(1) Exception handler number
A number known as the exception handler number is used to identify the CPU exception handler. Any number
0 or greater but less than the maximum number of exception handlers can be used. However, the relationship
between the exception handler number and the exception source must be determined by the user (by the type
of processing performed by the CPU exception handler).
It is assumed that the value of the ExcCode field of the cause register in the source file provided as a sample
will be used for the exception handler number.
(2) Defining/deleting CPU exception handlers
CPU exception handlers can be defined either by issuing the service call def_exc, or by specifying the static
API DEF_EXC, which performs equivalent processing to def_exc when the system is initialized.
If def_exc is issued, the kernel secures a control block in which it stores data such as the attribute and
activation address of the CPU exception handler, and then initializes that block.
A CPU exception handler definition is deleted by issuing the def_exc service call with the address of the CPU
exception handler definition packet set as NULL.
(3) Activating/terminating CPU exception handlers
A CPU exception handler is activated after an exception has occurred and the source of the exception
determined. A CPU exception handler is activated by specifying the exception handler number for vsta_exc,
and terminated by C language return or equivalent processing.
(4) PID
If PID (Position Independent Data) is used for the code created when the CPU exception handler program is
compiled or assembled, the address that is to be the base of a CPU exception handler when it is defined must
be assigned as a parameter (gp of the CPU exception handler definition packet T_DEXC). The assigned
address is set in the gp register when the CPU exception handler is activated.
Note that this base address is unconditionally set in the gp register regardless of its attribute, etc., and
therefore must be set for programs that reference the gp register. If the gp register is not referenced, set NULL
= 0.
(5) Use of coprocessor in CPU exception handler
To use the coprocessor in a CPU exception handler, the save and restore processing for the registers related
to the coprocessor (FPR0 to FPR31, FRC31) must be described in the CPU exception handler’s activate and
end sections, respectively. Furthermore, to assign FCR31 (control/status register) uniquely to the CPU
exception handler, describe processing to set this register in the activate section of the CPU exception handler.
(6) Issuance of service calls from CPU exception handler
The service calls that can be issued from a CPU exception handler are the same as those that can be issued
from an interrupt service routine: all service calls activation with i in the ixxx_yyy format.