30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.4. SYNCHRONIZATION AND COMMUNICATION FUNCTIONS 105<br />

tk ref mbx<br />

Reference Mailbox Status<br />

[C Language Interface]<br />

ER ercd = tk_ref_mbx ( ID mbxid, T_RMBX *pk_rmbx ) ;<br />

[Parameters]<br />

ID mbxid Mailbox ID<br />

T RMBX* pk rmbx Address of packet for returning status information<br />

[Return Parameters]<br />

ER ercd Error code<br />

pk rmbx detail:<br />

VP exinf Extended information<br />

ID wtsk Waiting task information<br />

T MSG* pk msg Start address of next message packet to be received<br />

(Other implementation-dependent parameters may be added beyond this point.)<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E PAR<br />

Normal completion<br />

Invalid ID number (mbxid is invalid or cannot be used)<br />

Object does not exist (the mailbox designated in mbxid does not exist)<br />

Parameter error (the return parameter packet address cannot be used)<br />

[Description]<br />

References the status of the mailbox designated in mbxid, passing in the return parameters the next<br />

message to be received (the first message in the message queue), waiting task information (wtsk), and<br />

extended information (exinf).<br />

wtsk indicates the ID of a task waiting for the mailbox. If there are multiple waiting tasks, the ID of<br />

the first task in the queue is returned. If there are no waiting tasks, wtsk = 0 is returned.<br />

If the designated mailbox does not exist, error code E NOEXS is returned.<br />

pk msg indicates the message that will be received the next time tk rcv mbx is issued. If there are no<br />

messages in the message queue, pk msg = NULL is returned. At least one of pk msg = NULL and<br />

wtsk = 0 is always true for this system call.<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!