Everything

ref_dtq

iref_dtq

Outline
Reference data queue state.
C format
 ER      ref_dtq (ID dtqid, T_RDTQ *pk_rdtq);
 ER      iref_dtq (ID dtqid, T_RDTQ *pk_rdtq);
Parameter(s)
I/O
Parameter
Description
I
 ID      dtqid;
ID number of the data queue.
O
 T_RDTQ  *pk_rdtq;
Pointer to the packet returning the data queue state.

[Data queue state packet: T_RDTQ]
 typedef struct  t_rdtq {
     ID      stskid;         /*Existence of tasks waiting for data transmission*/
     ID      rtskid;         /*Existence of tasks waiting for data reception*/
     UINT    sdtqcnt;        /*Number of data elements in data queue*/
 } T_RDTQ;

Explanation
These service calls store the detailed information of the data queue (existence of waiting tasks, number of data elements in the data queue, etc.) specified by parameter dtqid into the area specified by parameter pk_rdtq.
- stskid
Stores whether a task is queued to the transmission wait queue of the data queue.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the transmission wait queue
- rtskid
Stores whether a task is queued to the reception wait queue of the data queue.
TSK_NONE: No applicable task
Value: ID number of the task at the head of the reception wait queue
- sdtqcnt
Stores the number of data elements in data queue.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_PAR
-17
Parameter error.
- pk_rdtq == NULL
E_ID
-18
Invalid ID number.
- dtqid < 0
- dtqid > VTMAX_DTQ
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_dtq is issued from task or the ref_dtq 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_dtq)
- The operand-write access to the area indicated by pk_rdtq has not been permitted to the invoking task.
E_NOEXS
-42
Non-existent object.
- The data queue specified by dtqid does not exist.