CHAPTER 15 SYSTEM DOWN
This chapter describes the system down functions performed by the RI600PX.
When the event that cannot be recovered while the RI600PX is operating occurs, the system down is caused and the system down routine is invoked.
15.2
User-Own Coding Module
The system down routine must be implemented as user-own coding module.
Note The source file for the system down routine provided by the RI600PX as a sample file is "sysdwn.c".
15.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 cfg600px*/
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 15-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.
|
|
|
|
|
|
|
|
|
|
|
|
|
15.2.2 Parameters of system down routine
-
type == -1 (Error when a kernel interrupt handler ends)
Table 15-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.
|
|
|
|
Stack pointer points for the interrupted task points out of user stack for the task.
|
Table 15-3 Parameters of System Down Routine (
type == -2)
|
|
|
|
|
|
|
The ext_tsk is called in the non-task context.
|
|
|
The ext_tsk is called in the state "PSW.IPL > Kernel interrupt mask level".
|
-
type == -3 (Unlinked service call issued)
Table 15-4 Parameters of System Down Routine (
type == -3)
|
|
|
|
|
|
|
Unlinked service call is issued.
|
-
type == -4 (Error at returning from task exception handling routine)
Table 15-5 Parameters of System Down Routine (
type == -4)
|
|
|
|
|
|
|
A task exception handling routine returns in the state "PSW.IPL > Kernel interrupt mask level".
|
|
|
A task exception handling routine returns in the CPU locked state.
|
|
|
A task exception handling routine returns in the non-task context.
|
Table 15-6 Parameters of System Down Routine (
type == -5)
|
|
|
|
|
|
|
The exd_tsk is called in the state "PSW.IPL > Kernel interrupt mask level".
|
|
|
The exd_tsk is called in the non-task context.
|
Table 15-7 Parameters of System Down Routine (
type == -6)
|
|
|
|
|
|
|
|
1 ) Start address is not 16-bytes boundary.
2 ) Bit15 of either acptn1, acptn2 or acptn3 is 1.
3 ) acptn1 == acptn2 == acptn3 == 0
4 ) Bits corresponded to the domain ID that is larger than the maximum domain ID ( VTMAX_DOMAIN) of either acptn1, acptn2 or acptn3 is 1.
5 ) Start address > termination address
|
|
|
Multiple memory object with the same address are registered.
|
|
|
The number of memory objects from which the access is permitted to onedomain exceeds 7.
|
|
|
|
|
The "termination address of user stack + 1" is not 16-bytes boundary.
|
-
type == -16 (Undefined relocatable vector interrupt)
Table 15-8 Parameters of System Down Routine (
type == -16)
|
|
|
- "-U" option is not specified for cfg600px Undefined
- "-U" option is specified for cfg600px 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 15-9 Parameters of System Down Routine (type == -17)
|
|
|
- "-U" option is not specified for cfg600px Undefined
- "-U" option is specified for cfg600px 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 RI600PX. When calling
vsys_dwn,
ivsys_dwn from application, use positive
type value.
Table 15-10 Parameters of System Down Routine (type > 0)