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.1. TASK MANAGEMENT FUNCTIONS 49<br />

tk inf tsk<br />

Get Task Information<br />

[C Language Interface]<br />

ER ercd = tk_inf_tsk ( ID tskid, T_ITSK *pk_itsk, BOOL clr ) ;<br />

[Parameters]<br />

ID tskid Task ID<br />

T ITSK* pk itsk Address of packet for returning task information<br />

BOOL clr Clear task information<br />

[Return Parameters]<br />

ER ercd Error code<br />

pk itsk detail:<br />

RELTIM stime Cumulative system-level run time (ms)<br />

RELTIM utime Cumulative user-level run time (ms)<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 (tskid is invalid or cannot be used)<br />

Object does not exist (the task designated in tskid does not exist)<br />

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

[Description]<br />

Gets statistical information for the task designated in tskid.<br />

If clr = TRUE ≠ 0, the cumulative information is reset (cleared to 0) after getting the information.<br />

The invoking task can be designated by setting tskid = TSK SELF = 0. Note, however, that when a<br />

system call is issued from a task-independent portion and tskid = TSK SELF = 0 is designated, error<br />

code E ID is returned.<br />

[Additional Notes]<br />

The system-level run time is that while running at TA RNG0, and the user-level run time is that while<br />

running at protection levels other than TA RNG0. A task created to run at TA RNG0 is therefore counted<br />

entirely as system-level run time.<br />

The method of counting run time is implementation-dependent, but does not need to be especially<br />

precise. In fact, applications should not expect very high precision.<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!