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.7. TIME MANAGEMENT FUNCTIONS 169<br />

tk cre cyc<br />

Create Cyclic Handler<br />

[C Language Interface]<br />

ID cycid = tk_cre_cyc ( T_CCYC *pk_ccyc ) ;<br />

[Parameters]<br />

T CCYC* pk ccyc Address of cyclic handler definition packet<br />

pk ccyc detail:<br />

VP exinf Extended information<br />

ATR cycatr Cyclic handler attributes<br />

FP cychdr Cyclic handler address<br />

RELTIM cyctim Cycle time<br />

RELTIM cycphs Cycle phase<br />

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

[Return Parameters]<br />

ID cycid Cyclic handler 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 cyclic handlers exceeds the system limit<br />

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

Parameter error (pk ccyc, cychdr, cyctim, or cycphs is invalid or cannot be used)<br />

[Description]<br />

Creates a cyclic handler, assigning to it a cyclic handler ID. A cyclic handler is a handler running at<br />

designated intervals as a task-independent portion.<br />

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

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

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

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

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

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

high bits. Designation in the system attributes part of cycatr 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!