CHAPTER 15 SYSTEM DOWN


This chapter describes the system down functions performed by the RI600PX.

15.1 Outline

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

Bit

Value

Note

I

0

IPL

- type < 0 : Undefined

- type >= 0 : Same before system down

Do not lower IPL more than the start of processing.

PM

0

Supervisor mode

U

0

System stack

C, Z, S, O

undefined

Others

0



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)

inf1

inf2

inf3

Description

E_CTX (-25)

2

undefined

PSW.PM == 1 (user mode) when a kernel interrupt handler ends.

3

undefined

PSW.IPL > kernel interrupt mask level when a kernel interrupt handler ends.

5

undefined

The system is in the CPU locked state when a kernel interrupt handler ends.

E_MACV (-26)

12

undefined

Stack pointer points for the interrupted task points out of user stack for the task.



- type == -2 (Error in ext_tsk)

Table 15-3 Parameters of System Down Routine (type == -2)

inf1

inf2

inf3

Description

E_CTX (-25)

1

undefined

The ext_tsk is called in the non-task context.

4

undefined

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)

inf1

inf2

inf3

Description

E_NOSPT (-9)

undefined

undefined

Unlinked service call is issued.



Note Refer to "2.6.1 Service call information files and "-ri600_preinit_mrc" compiler option".

- type == -4 (Error at returning from task exception handling routine)

Table 15-5 Parameters of System Down Routine (type == -4)

inf1

inf2

inf3

Description

E_CTX (-25)

7

undefined

A task exception handling routine returns in the state "PSW.IPL > Kernel interrupt mask level".

8

undefined

A task exception handling routine returns in the CPU locked state.

9

undefined

A task exception handling routine returns in the non-task context.



- type == -5 (Error in exd_tsk)

Table 15-6 Parameters of System Down Routine (type == -5)

inf1

inf2

inf3

Description

E_CTX (-25)

10

undefined

The exd_tsk is called in the state "PSW.IPL > Kernel interrupt mask level".

11

undefined

The exd_tsk is called in the non-task context.



- type == -6 (Error in vsta_knl and ivsta_knl)

Table 15-7 Parameters of System Down Routine (type == -6)

inf1

inf2

inf3

Description

E_PAR (-17)

15

undefined

Error regarding to

registration of

memory object

(memory_object[])

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

E_OBJ (-41)

undefined

Multiple memory object with the same address are registered.

E_OACV (-27)

undefined

The number of memory objects from which the access is permitted to onedomain exceeds 7.

E_PAR (-17)

16

undefined

Error regarding to

task creation

(task[])

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)

inf1

inf2

inf3

- "-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)

inf1

inf2

inf3

- "-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)

inf1

inf2

inf3

Value specified for vsys_dwn, ivsys_dwn