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.

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

tk ref mpl<br />

Reference Variable-size Memory Pool Status<br />

[C Language Interface]<br />

ER ercd = tk_ref_mpl ( ID mplid, T_RMPL *pk_rmpl ) ;<br />

[Parameters]<br />

ID mplid Variable-size memory pool ID<br />

T RMPL* pk rmpl Address of packet for returning status information<br />

[Return Parameters]<br />

ER ercd Error code<br />

pk rmpl detail:<br />

VP exinf Extended information<br />

ID wtsk Waiting task information<br />

INT frsz Free memory size (in bytes)<br />

INT maxsz Maximum memory space size (in bytes)<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 (mplid is invalid or cannot be used)<br />

Object does not exist (the variable-size memory pool designated in mplid does not exist)<br />

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

[Description]<br />

References the status of the variable-size memory pool designated in mplid, passing in return parameters<br />

the total size of free space frsz, the maximum size of memory immediately available maxsz, waiting<br />

task information (wtsk), and extended information (exinf).<br />

wtsk indicates the ID of a task waiting for memory block allocation from this variable-size memory<br />

pool. If multiple tasks are waiting for the variable-size memory pool, the ID of the task at the head of<br />

the queue is returned. If there are no waiting tasks, wtsk = 0 is returned.<br />

If the variable-size memory pool designated with tk ref mpl does not exist, error code E NOEXS is<br />

returned.<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!