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.

4.4. SYNCHRONIZATION AND COMMUNICATION FUNCTIONS 87<br />

tk cre flg<br />

Create Event Flag<br />

[C Language Interface]<br />

ID flgid = tk_cre_flg ( T_CFLG *pk_cflg ) ;<br />

[Parameters]<br />

T CFLG* pk cflg Information about the event flag to be created<br />

pk cflg detail:<br />

VP exinf Extended information<br />

ATR flgatr Event flag attributes<br />

UINT iflgptn Initial event flag pattern<br />

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

[Return Parameters]<br />

ID flgid Event flag 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 control block cannot be allocated)<br />

Number of event flags exceeds the system limit<br />

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

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

[Description]<br />

Creates an event flag, assigning to it an event flag ID.<br />

This system call allocates a control block to the created event flag and sets its initial value to iflgptn.<br />

An event flag handles one word’s worth of bits as a group. All operations are performed in single word<br />

units.<br />

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

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

indicating user information, or if the information may need to be changed after the event flag 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 />

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

high bits. Designation in the system attributes part of flgatr is as follows.<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!