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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

tk ref mpf<br />

Reference Fixed-size Memory Pool Status<br />

[C Language Interface]<br />

ER ercd = tk_ref_mpf ( ID mpfid, T_RMPF *pk_rmpf ) ;<br />

[Parameters]<br />

ID mpfid Fixed-size memory pool ID<br />

T RMPF* pk rmpf Address of packet for returning status information<br />

[Return Parameters]<br />

ER ercd Error code<br />

pk rmpf detail:<br />

VP exinf Extended information<br />

ID wtsk Waiting task information<br />

INT frbcnt Free block count<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 (mpfid is invalid or cannot be used)<br />

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

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

[Description]<br />

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

the current free block count frbcnt, waiting task information (wtsk), and extended information (exinf).<br />

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

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

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

If the fixed-size memory pool designated with tk ref mpf does not exist, error code E NOEXS is returned.<br />

At least one of frbcnt = 0 and wtsk = 0 is always true for this system call.<br />

[Additional Notes]<br />

Whereas frsz returned by tk ref mpl gives the total free memory size in bytes, frbcnt returns the<br />

number of unused memory blocks.<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!