cre_dtq
acre_dtq
ER cre_dtq (ID dtqid, T_CDTQ *pk_cdtq );
ER_ID acre_dtq ( T_CDTQ *pk_cdtq );
typedef struct t_cdtq { ATR dtqatr; /*Data queue attribute*/ UINT dtqcnt; /*Capacity of the data queue area (the number of data elements)*/ VP dtq; /*Start address of the data queue area*/ } T_CDTQ; |
The cre_dtq creates a data queue with data queue ID indicated by dtqid according to the content of pk_cdtq. The acre_dtq creates a data queue according to the content of pk_cdtq, and returns the created data queue ID.
dtqatr := ( TA_TFIFO || TA_TPRI
- TA_TPRI ( = 0x0001)
Task wait queue for sending is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
Task wait queue for sending is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
2 ) Capacity of the data queue area (dtqcnt), Start address of the data queue area (dtq)
The application acquires TSZ_DTQ(dtqcnt) bytes of data queue area and specifies the start address for dtq.
It is also possible to specify 0 as dtqcnt. In this case, since data cannot be stored in the data queue, the data sending task or data receiving task that has performed its operation first will enter the WAITING state. The WAITING state of that task is canceled when the task of another side has performed its operation. Thus, data sending tasks and data receiving tasks are completely synchronized. Note, dtq is disregarded when dtqcnt is 0.
The application acquires TSZ_DTQ(dtqcnt) bytes of data queue area and specifies the start address for dtq.
It is also possible to specify 0 as dtqcnt. In this case, since data cannot be stored in the data queue, the data sending task or data receiving task that has performed its operation first will enter the WAITING state. The WAITING state of that task is canceled when the task of another side has performed its operation. Thus, data sending tasks and data receiving tasks are completely synchronized. Note, dtq is disregarded when dtqcnt is 0.
Note 2 The RI600PX is not concerned of anything of the access permission to the data queue area. Usually, the data queue area should be generated to the area other than memory objects and user stacks. When the data queue area is generated in the memory object, a task with the operand-write access permission to the memory object might rewrite data queue area by mistake.
Note 3 The mITRON4.0 specification defines the function that the kernel allocates data queue area when NULL is specified for dtq. But RI600PX does not support this function.