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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

98 CHAPTER 4. T-KERNEL/OS FUNCTIONS<br />

tk cre mbx<br />

Create Mailbox<br />

[C Language Interface]<br />

ID mbxid = tk_cre_mbx ( T_CMBX* pk_cmbx ) ;<br />

[Parameters]<br />

T CMBX* pk cmbx Information about the mailbox to be created<br />

pk cmbx detail:<br />

VP exinf Extended information<br />

ATR mbxatr Mailbox attributes<br />

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

[Return Parameters]<br />

ID mbxid Mailbox ID<br />

or Error Code<br />

[Error Codes]<br />

E OK<br />

E NOMEM<br />

E LIMIT<br />

E RSATR<br />

E PAR<br />

Normal completion<br />

Insufficient memory (memory for a control block or buffer cannot be allocated)<br />

Number of mailboxes exceeds the system limit<br />

Reserved attribute (mbxatr is invalid or cannot be used)<br />

Parameter error (pk cmbx is invalid)<br />

[Description]<br />

Creates a mailbox, assigning to it a mailbox ID.<br />

This system call allocates a control block, etc. for the created mailbox.<br />

exinf can be used freely by the user to set miscellaneous information about the created mailbox. The<br />

information set in this parameter can be referenced by tk ref mbx. If a larger area is needed for<br />

indicating user information, or if the information may need to be changed after the mailbox is created,<br />

this can be done by allocating separate memory for this purpose and putting the memory packet address<br />

in exinf. The OS pays no attention to the contents of exinf.<br />

mbxatr indicates system attributes in its low bits and implementation-dependent information in the<br />

high bits. Designation in the system attributes part of mbxatr is as follows.<br />

mbxatr:= (TA_TFIFO || TA_TPRI) | (TA_MFIFO || TA_MPRI) | [TA\_NODISWAI]<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!