CHAPTER 13 SYSTEM DOWN
This chapter describes the system down functions performed by the RI600V4.
When the event that cannot be recovered while the RI600V4 is operating occurs, the system down is caused and the system down routine is invoked.
13.2
User-Own Coding Module
The system down routine must be implemented as user-own coding module.
13.2.1 System down routine (_RI_sys_dwn__)
The following shows the basic form of the system down routine. The system down routine must not return.
#include "kernel.h" /*Standard header file definition*/
#include "kernel_id.h" /*Header file generated by cfg600*/
void _RI_sys_dwn__ ( W type, VW inf1, VW inf2, VW inf3 ); /*Prototype declaration*/
void _RI_sys_dwn__ ( W type, VW inf1, VW inf2, VW inf3 )
{
/* ......... */
while(1);
}
|
Note The function name of the system down routine is "_RI_sys_dwn__".
- Stack
The system down routine uses the system stack.
- Service call
The system down routine must not issue service calls.
- PSW register when processing is started
Table 13-1 PSW Register When System Down Routine is Started
|
|
|
|
|
|
|
- type >= 0 : Same before system down
|
Do not lower IPL more than the start of processing.
|
|
|
|
|
|
|
|
|
|
|
|
|
13.2.2 Parameters of system down routine
-
type == -1 (Error when a kernel interrupt handler ends)
Table 13-2 Parameters of System Down Routine (
type == -1)
|
|
|
|
|
|
|
PSW.PM == 1 (user mode) when a kernel interrupt handler ends.
|
|
|
PSW.IPL > kernel interrupt mask level when a kernel interrupt handler ends.
|
|
|
The system is in the CPU locked state when a kernel interrupt handler ends.
|
Table 13-3 Parameters of System Down Routine (
type == -2)
|
|
|
|
|
|
|
The ext_tsk is called in the non-task context.
|
|
|
PSW.IPL > kernel interrupt mask level when ext_tsk is called.
|
-
type == -3 (Unlinked service call issued)
Table 13-4 Parameters of System Down Routine (
type == -3)
|
|
|
|
|
|
|
Unlinked service call is issued.
|
-
type == -16 (Undefined relocatable vector interrupt)
Table 13-5 Parameters of System Down Routine (
type == -16)
|
|
|
- "-U" option is not specified for cfg600 Undefined
- "-U" option is specified for cfg600 Vector number
|
PC, which is pushed to the stack by CPU's interrupt operation
|
PSW, which is pushed to the stack by CPU's interrupt operation
|
-
type == -17 (Undefined fixed vector/exception vector interrupt)
Table 13-6 Parameters of System Down Routine (type == -17)
|
|
|
- "-U" option is not specified for cfg600 Undefined
- "-U" option is specified for cfg600 Vector number
|
PC, which is pushed to the stack by CPU's interrupt operation
|
PSW, which is pushed to the stack by CPU's interrupt operation
|
-
type > 0 (Issuing
vsys_dwn,
ivsys_dwn from application))
0 and a negative
type value is reserved by the RI600V4. When calling
vsys_dwn,
ivsys_dwn from application, use positive
type value.
Table 13-7 Parameters of System Down Routine (type > 0)