Everything

cre_mbx

acre_mbx

Outline
Create mailbox.
C format
 ER      cre_mbx (ID mbxid, T_CMBX *pk_cmbx );
 ER_ID   acre_mbx ( T_CMBX *pk_cmbx );
Parameter(s)
I/O
Parameter
Description
I
 ID      mbxid;
ID number of the mailbox.
I
 T_CMBX  *pk_cmbx;
Pointer to the packet containing the mailbox creation information.

[Mailbox creation information packet : T_CMBX]
 typedef struct  t_cmbx {
     ATR    mbxatr;         /*Mailbox attribute*/
     PRI    maxmpri;        /*Maximum message priority*/
     VP     mprihd;         /*For future expansion*/
 } T_CMBX;

Explanation
This service call can be called from tasks that belong to Trusted Domain.
The cre_mbx creates a mailbox with mailbox ID indicated by mbxid according to the content of pk_cmbx. The acre_mbx creates a mailbox according to the content of pk_cmbx, and returns the created mailbox ID.
1 ) Mailbox attribute (mbxatr)
The following are specified for mbxatr.
   mbxatr := ( ( TA_TFIFO || TA_TPRI  | ( TA_MFIFO || TA_MPRI ) )
- TA_TFIFO ( = 0x0000)
Task wait queue is managed in FIFO order.
- TA_TPRI ( = 0x0001)
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
- TA_MFIFO ( = 0x0000)
Message queue is managed in FIFO order.
- TA_MPRI ( = 0x0002)
Message queue is managed in message priority order. Among messages with the same priority, they are queued in FIFO order.
2 ) Maximum message priority (maxmpri)
When TA_MPRI is specified for mbxatr, the range of message priority which can be used is from 1 to maxmpri. Ranges of the value that can be specified are from 1 to TMAX_MPRI.
3 ) mpdihd
The mprihd is for future expansion, and is only disregarded.
Return value
Macro
Value
Description
-
Positive value
Normal completion of acre_mbx. (Created mailbox ID)
E_OK
0
Normal completion of cre_mbx.
E_RSATR
-11
Reserved attribute
- Either of bits in mbxatr except bit0 and bit1 is 1.
E_PAR
-17
Parameter error.
- pk_cmbx == NULL
- When TA_MPRI is specified
- maxmpri <= 0
- maxmpri > TMAX_MPRI
E_ID
-18
Invalid ID number. (only for cre_mbx)
- mbxid < 0
- mbxid > VTMAX_MBX
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
- This service call 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.
- Stack pointer points out of user stack for invoking task.
- The operand-read access to the area indicated by pk_cmbx has not been permitted to the invoking task.
E_OACV
-27
Object access violation.
- The invoking task does not belong to trusted domain.
E_NOID
-34
No ID number available.(only for acre_mbx)
E_OBJ
-41
Object state error. (only for cre_mbx)
- The mailbox specified by mbxid exists.