get_pri

iget_pri

Outline

Reference task current priority.

C format

 ER      get_pri (ID tskid, PRI *p_tskpri);
 ER      iget_pri (ID tskid, PRI *p_tskpri);
Parameter(s)

I/O

Parameter

Description

I

 ID      tskid;
ID number of the task.

TSK_SELF: Invoking task.

Value: ID number of the task.

O

 PRI     *p_tskpri;
Pointer to the area returning the current priority of the task.



Explanation

This service call stores the current priority of the task specified by parameter tskid in the area specified by parameter p_tskpri.

Note For current priority and base priority, refer to "8.2.2 Current priority and base priority".

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- p_tskpri == NULL

E_ID

-18

Invalid ID number.

- tskid < 0

- tskid > VTMAX_TSK

- When this service call 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.

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

Note When the iget_pri is issued from task or the get_pri is issued from non-task, the context error is not detected and normal operation of the system is not guaranteed.

E_MACV

-26

Memory access violation. (only for get_pri)

- The operand-write access to the area indicated by p_tskpri has not been permitted to the invoking task.

E_OBJ

-41

Object state error.

- Specified task is in the DORMANT state.

E_NOEXS

-42

Non-existent object.

- The task specified by tskid does not exist.