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.

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

tk cre mpl<br />

Create Variable-size Memory Pool<br />

[C Language Interface]<br />

ID mplid = tk_cre_mpl ( T_CMPL *pk_cmpl ) ;<br />

[Parameters]<br />

T CMPL* pk cmpl Information about the variable-size memory pool to be created<br />

pk cmpf detail:<br />

VP exinf Extended information<br />

ATR mplatr Memory pool attributes<br />

INT mplsz Memory pool size (in bytes)<br />

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

[Return Parameters]<br />

ID mplid Variable-size memory pool 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 or memory pool area cannot be allocated)<br />

Number of variable-size memory pools exceeds the system limit<br />

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

Parameter error (pk cmpl is invalid, or mplsz is negative or invalid)<br />

[Description]<br />

Creates a variable-size memory pool, assigning to it a variable-size memory pool ID.<br />

This system call allocates a memory space for use as a memory pool, based on the information in<br />

parameter mplsz, and allocates a control block to the created memory pool.<br />

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

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

for indicating user information, or if the information may need to be changed after the memory pool<br />

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

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

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

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

mplatr:= (TA_TFIFO || TA_TPRI) | [TA_NODISWAI]<br />

| (TA_RNG0 || TA_RNG1 || TA_RNG2 || TA_RNG3)<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!