ref_mbf

iref_mbf

Outline

Reference message buffer state.

C format

 ER      ref_mbf (ID mbfid, T_RMBF *pk_rmbf);
 ER      iref_mbf (ID mbfid, T_RMBF *pk_rmbf);
Parameter(s)

I/O

Parameter

Description

I

 ID      mbfid;
ID number of the message.

O

 T_RMBF  *pk_rmbf;
Pointer to the packet returning the message buffer state.



[Message buffer state packet: T_RMBF]

 typedef struct  t_rmbf {
     ID      stskid;         /*Existence of tasks waiting for message transmission*/
     ID      rtskid;         /*Existence of tasks waiting for message reception*/
     UINT    smsgcnt;        /*Number of message elements in message buffer*/
     SIZE    fmbfsz;         /*Available buffer size*/
 } T_RMBF;


Explanation

These service calls store the detailed information of the message buffer (existence of waiting tasks, number of data elements in the message buffer, etc.) specified by parameter mbfid into the area specified by parameter pk_rmbf.

- stskid
Stores whether a task is queued to the transmission wait queue of the message buffer.

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 message buffer.

TSK_NONE: No applicable task

Value: ID number of the task at the head of the reception wait queue

- smsgcnt
Stores the number of message elements in message buffer.

- fmbfsz
Stores available size of the message buffer (in bytes).

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- pk_rmbf == NULL

E_ID

-18

Invalid ID number.

- mbfid < 0

- mbfid > VTMAX_MBF

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_mbf is issued from task or the ref_mbf 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_mbf)

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

E_NOEXS

-42

Non-existent object.

- The message buffer specified by mbfid does not exist.