Everything

ref_tst

iref_tst

Outline
Reference task state (simplified version).
C format
 ER      ref_tst (ID tskid, T_RTST *pk_rtst);
 ER      iref_tst (ID tskid, T_RTST *pk_rtst);
Parameter(s)
I/O
Parameter
Description
I
 ID      tskid;
ID number of the task to be referenced.
TSK_SELF: Invoking task.
Value: ID number of the task to be referenced.
O
 T_RTST  *pk_rtst;
Pointer to the packet returning the task state.

[Task state packet (simplified version): T_RTST]
 typedef struct  t_rtst {
     STAT    tskstat;        /*Current state*/
     STAT    tskwait;        /*Reason for waiting*/
 } T_RTST;

Explanation
Stores task state packet (current state, reason for waiting) of the task specified by parameter tskid in the area specified by parameter pk_rtst.
Used for referencing only the current state and reason for wait among task information.
Response becomes faster than using ref_tsk or iref_tsk because only a few information items are acquired.
Note For details about the task state packet (simplified version), refer to "15.2.2 Task state packet (simplified version)".
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_ID
-18
Invalid ID number.
- tskid < 0x0
- tskid > Maximum ID number
- When this service call was issued from a non-task, TSK_SELF was specified tskid.
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
E_NOEXS
-42
Non-existent object.
- Specified task is not registered.