psnd_mbf

ipsnd_mbf

Outline

Send to message buffer (polling).

C format

 ER      psnd_mbf (ID mbfid, VP msg, UINT msgsz);
 ER      ipsnd_mbf (ID mbfid, VP msg, UINT msgsz);
Parameter(s)

I/O

Parameter

Description

I

 ID      mbfid;
ID number of the message buffer.

I

 VP      msg;
Pointer to the message to be sent.

I

 UINT    msgsz;
Message size to be sent (in bytes).



Explanation

These service calls process as follows according to the situation of the message buffer specified by the parameter mbfid.

- There is a task in the reception wait queue.
This service call transfers the message specified by parameter msg to the task in the top of the reception wait queue. As a result, the task is unlinked from the reception wait queue and moves from the WAITING state (message reception wait state) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state.


- There is no task neither in the reception wait queue and transmission wait queue and there is available space in the message buffer.
This service call stores the message specified by parameter msg to the message buffer. As a result, the size of available space in the target message buffer decreases by the amount calculated by the following expression.


The amount of decrease = up4( msgsz ) + VTSZ_MBFTBL

- There is no task neither in the reception wait queue and transmission wait queue and there is no available space in the message buffer, or there is a task in the transmission wait queue.
These service calls return "E_TMOUT".


Note Message is written to the message buffer area in the order of the message transmission request.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- msgsz == 0

- msgsz > (Maximum message size specified at creation)

- msg == 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.

- The ipsnd_mbf was issued from task.

- The psnd_mbf was issued from non-task.

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

E_MACV

-26

Memory access violation. (only for psnd_mbf)

- Stack pointer points out of user stack for invoking task.

- The operand-read access to the area indicated by msg (start : msg, size : msgsz) has not been permitted to the invoking task.

E_NOEXS

-42

Non-existent object.

- The message buffer specified by mbfid does not exist.

E_TMOUT

-50

Polling failure.