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 27<br />

tk cre tsk<br />

Create Task<br />

[C Language Interface]<br />

ID tskid = tk_cre_tsk ( T_CTSK *pk_ctsk ) ;<br />

[Parameters]<br />

T CTSK* pk ctsk Information about the task to be created<br />

pk ctsk detail:<br />

VP exinf Extended information<br />

ATR tskatr Task attributes<br />

FP task Task start address<br />

PRI itskpri Initial task priority<br />

INT stksz Stack size (bytes)<br />

INT sstksz System stack size (bytes)<br />

VP stkptr User stack pointer<br />

VP uatb Task space page table<br />

INT lsid Logical space ID<br />

ID resid Resource ID<br />

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

[Return Parameters]<br />

ID tskid Task ID<br />

or Error Code<br />

[Error Codes]<br />

E NOMEM<br />

E LIMIT<br />

E RSATR<br />

E NOSPT<br />

E PAR<br />

E ID<br />

E NOCOP<br />

Insufficient memory (memory for control block or user stack cannot be allocated)<br />

Number of tasks exceeds the system limit<br />

Reserved attribute (tskatr is invalid or cannot be used), or the designated coprocessor<br />

does not exist<br />

Unsupported function (when TA USERSTACK or TA TASKSPACE is not supported)<br />

Parameter error<br />

Invalid resource ID (resid)<br />

The designated coprocessor cannot be used (not installed, or abnormal operation detected)<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!