Everything

ref_flg

iref_flg

Outline
Reference eventflag state.
C format
 ER      ref_flg (ID flgid, T_RFLG *pk_rflg);
 ER      iref_flg (ID flgid, T_RFLG *pk_rflg);
Parameter(s)
I/O
Parameter
Description
I
 ID      flgid;
ID number of the eventflag.
O
 T_RFLG  *pk_rflg;
Pointer to the packet returning the eventflag state.

[Eventflag state packet: T_RFLG]
 typedef struct  t_rflg {
     ID      wtskid;         /*Existence of waiting task*/
     FLGPTN  flgptn;         /*Current bit pattern*/
 } T_RFLG;

Explanation
Stores eventflag state packet (ID number of the task at the head of the wait queue, current bit pattern, etc.) of the eventflag specified by parameter flgid in the area specified by parameter pk_rflg.
- wtskid
Stores whether a task is queued to the event flag wait queue.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the wait queue
- flgptn
Stores the current bit pattern.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_PAR
-17
Parameter error.
- pk_rflg == NULL
E_ID
-18
Invalid ID number.
- flgid < 0
- flgid > VTMAX_FLG
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 iref_flg is issued from task or the ref_flg 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 ref_flg)
- The operand-write access to the area indicated by pk_rflg has not been permitted to the invoking task.
E_NOEXS
-42
Non-existent object.
- The eventflag specified by flgid does not exist.