Renesas M3T-MR100 Network Card User Manual


 
- 128 -
snd_mbx Send to mailbox
isnd_mbx Send to mailbox (handler only)
[
[
[
[
C
C
L
L
a
a
n
n
g
g
u
u
a
a
g
g
e
e
A
A
P
P
I
I
]
]
]
]
ER ercd = snd_mbx( ID mbxid, T_MSG *pk_msg );
ER ercd = isnd_mbx( ID mbxid, T_MSG *pk_msg );
z
z
P
P
a
a
r
r
a
a
m
m
e
e
t
t
e
e
r
r
s
s
ID mbxid ID number of the mailbox to which transmitted
T_MSG *pk_msg Message to be transmitted
z
z
R
R
e
e
t
t
u
u
r
r
n
n
P
P
a
a
r
r
a
a
m
m
e
e
t
t
e
e
r
r
s
s
ER ercd Terminated normally (E_OK)
[
[
[
[
A
A
s
s
s
s
e
e
m
m
b
b
l
l
y
y
l
l
a
a
n
n
g
g
u
u
a
a
g
g
e
e
A
A
P
P
I
I
]
]
]
]
.include mr100.inc
snd_mbx MBXID,PK_MBX
isnd_mbx MBXID,PK_MBX
z
z
P
P
a
a
r
r
a
a
m
m
e
e
t
t
e
e
r
r
s
s
MBXID ID number of the mailbox to which transmitted
PK_MBX Message to be transmitted (address)
z
z
R
R
e
e
g
g
i
i
s
s
t
t
e
e
r
r
c
c
o
o
n
n
t
t
e
e
n
n
t
t
s
s
a
a
f
f
t
t
e
e
r
r
s
s
e
e
r
r
v
v
i
i
c
c
e
e
c
c
a
a
l
l
l
l
i
i
s
s
i
i
s
s
s
s
u
u
e
e
d
d
Register name Content after service call is issued
R0 Error code
R2 ID number of the mailbox to which transmitted
A1 Message to be transmitted (address)
[
[
[
[
S
S
t
t
r
r
u
u
c
c
t
t
u
u
r
r
e
e
o
o
f
f
t
t
h
h
e
e
m
m
e
e
s
s
s
s
a
a
g
g
e
e
p
p
a
a
c
c
k
k
e
e
t
t
]
]
]
]
<<Mailbox message header>>
typedef struct t_msg{
VP msghead +0 4 Kernel managed area
} T_MSG;
<<Mailbox message header with priority included>>
typedef struct t_msg{
T_MSG msgque +0 4 Message header
PRI msgpri +2 2 Message priority
} T_MSG;
[
[
[
[
E
E
r
r
r
r
o
o
r
r
c
c
o
o
d
d
e
e
]
]
]
]
None
[
[
[
[
F
F
u
u
n
n
c
c
t
t
i
i
o
o
n
n
a
a
l
l
d
d
e
e
s
s
c
c
r
r
i
i
p
p
t
t
i
i
o
o
n
n
]
]
]
]
This service call sends the message indicated by pk_msg to the mailbox indicated by mbxid. T_MSG* should be specified
with a 32-bit address. If there is any task waiting to receive a message in the target mailbox, the transmitted message is
passed to the task at the top of the waiting queue, and the task is released from WAITING state.
To send a message to a mailbox whose attribute is TA_MFIFO, add a T_MSG structure at the beginning of the message
when creating it, as shown in the example below.
To send a message to a mailbox whose attribute is TA_MPRI, add a T_MSG_PRI structure at the beginning of the message
when creating it, as shown in the example below.
Messages should always be created in a RAM area regardless of whether its attribute is TA_MFIFO or TA_MPRI.
The T_MSG area is used by the kernel, so that it cannot be rewritten after a message has been sent. If this area is rewritten
before the message is received after it was sent, operation of the service call cannot be guaranteed.
If this service call is to be issued from task context, use snd_mbx; if issued from non-task context, use isnd_mbx.