snd_mbx

isnd_mbx

Outline

Send to mailbox.

C format

 ER      snd_mbx (ID mbxid, T_MSG *pk_msg);
 ER      isnd_mbx (ID mbxid, T_MSG *pk_msg);
Parameter(s)

I/O

Parameter

Description

I

 ID      mbxid;
ID number of the mailbox.

I

 T_MSG   *pk_msg;
Start address of the message packet to be sent to the mailbox.



[Message packet T_MSG for TA_MFIFO attribute]

 typedef struct {
     VP      msghead;       /*RI600PX management area*/
 } T_MSG;


[Message packet for T_MSG_PRI for TA_MPRI attribute]

 typedef struct {
     T_MSG   msgque;        /*Message header*/
     PRI     msgpri;        /*Message priority*/
 } T_MSG_PRI;


Explanation

This service call transmits the message specified by parameter pk_msg to the mailbox specified by parameter mbxid (queues the message in the wait queue).

If a task is queued to the target mailbox wait queue when this service call is issued, the message is not queued but handed over to the relevant task (first task of the wait queue).

As a result, the relevant task is unlinked from the wait queue and is moved from the WAITING state (receiving WAITING state for a mailbox) to the READY state, or from the WAITING-SUSPENDED state to the SUSPENDED state.

Note 1 Messages are queued to the target mailbox message queue in the order specified at creating the mailbox (FIFO order or message priority order).

Note 2 Do not modify transmitted message (the area indicated by pk_msg) until the message is received.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- pk_msg == NULL

- When the target mailbox has TA_MPRI attribute:

- msgpri < 0

- msgpri > TMAX_MPRI

E_ID

-18

Invalid ID number.

- mbxid < 0

- mbxid > VTMAX_MBX

E_CTX

-25

Context error.

- This service call was issued in the CPU locked state.

- The isnd_mbx was issued from task.

- The snd_mbx 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 snd_mbx)

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

- The operand-read and operand-write access to the message header area has not been permitted to the invoking task.
Message header area:


- TA_MFIFO attribute : The T_MSG structure started from the address indicated by pk_msg

- TA_MPRI attribute : The T_MSG_PRI structure started from the address indicated by pk_msg

E_NOEXS

-42

Non-existent object.

- The mailbox specified by mbxid does not exist.