ras_tex

iras_tex

Outline

Raise task exception.

C format

 ER      ras_tex ( ID tskid, TEXPTN rasptn );
 ER      iras_tex ( ID tskid, TEXPTN rasptn );
Parameter(s)

I/O

Parameter

Description

I

 ID      tskid;
ID number of the task.

TSK_SELF: Invoking task.

Value: ID number of the task.

I

 TEXPTN  rasptn;
Task exception code to be requested.



Explanation

This service call requests task exception handling for the task indicated by tskid. The task pending exception code for the task is ORed with the value indicated by rasptn.

When the conditions for starting task exception handling routine are satisfied, the task exception handling routine is invoked. Please refer to "6.2.3 The starting conditions of task exception handling routines" for the conditions for starting task exception handling routine.

When a task exception handling routine is invoked, the task pending exception code is cleared to 0, and the task exception handling is disabled. The pending exception code before clear and extended information for the task are passed to the task exception handling routine.

At the return from a task exception handling routine, the task exception is enabled, and the task restarts execution from the point immediately before the start of the task exception handling routine.

When a task exception handling routine returns, the RI600PX saves context registers for the task to the user stack. If the user stack is overflow, system goes down.

It is necessary to release from CPU locked state by the end of a task exception handling routine when shifting to the CPU locked state in a task exception handling routine. If CPU is locked at the end of a task exception handling routine, system goes down.

The interrupt priority level (PSW.IPL) before and after the start of a task exception handling routine is not changed. And the interrupt priority level before and after the return from a task exception handling routine is not changed. When the interrupt priority level at the end of a task exception handling routine is higher than the kernel interrupt mask level, system goes down.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- rasptn == 0

E_ID

-18

Invalid ID number.

- tskid < 0

- tskid > VTMAX_TSK

- When iras_tex was issued from a non-task, TSK_SELF was specified for tskid.

E_CTX

-25

Context error.

- This service call was issued in the CPU locked state.

- The iras_tex was issued from task.

- The ras_tex was issued from non-task.

- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".

E_MACV

-26

Memory access violation. (only for ras_tex)

- Stack pointer points out of user stack for invoking task.

E_OBJ

-41

Object state error.

- Specified task is neither in the WAITING state nor WAITING-SUSPENDED state.

E_NOEXS

-42

Non-existent object.

- The task specified by tskid does not exist.