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.

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

tk acp por<br />

Accept Port for Rendezvous<br />

[C Language Interface]<br />

INT cmsgsz = tk_acp_por ( ID porid, UINT acpptn, RNO *p_rdvno, VP msg, TMO tmout ) ;<br />

[Parameters]<br />

ID porid Rendezvous port ID<br />

UINT acpptn Accept bit pattern (indicating conditions for acceptance)<br />

VP msg Message packet address<br />

TMO tmout Timeout designation<br />

[Return Parameters]<br />

ER ercd Error code<br />

RNO rdvno Rendezvous number<br />

INT cmsgsz Call message size (in bytes)<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E PAR<br />

E DLT<br />

E RLWAI<br />

E DISWAI<br />

E TMOUT<br />

E CTX<br />

Normal completion<br />

Invalid ID number (porid is invalid or cannot be used, or porid is a rendezvous port of<br />

another node)<br />

Object does not exist (the rendezvous port designated in porid does not exist)<br />

Parameter error (acpptn = 0, value that cannot be used in msg, or tmout ≤ (−2))<br />

The object being waited for was deleted (the rendezvous port was deleted while waiting)<br />

Wait state released (tk rel wai received in wait state)<br />

Wait released by wait disabled state<br />

Polling failed or timeout<br />

Context error (issued from task-independent portion or in dispatch disabled state)<br />

[Description]<br />

Accepts a rendezvous on a rendezvous port.<br />

The specific operation of tk acp por is as follows. A rendezvous is established if there is a task queued<br />

for a rendezvous call at the port designated in porid and if rendezvous conditions of that task and the<br />

task issuing this call overlap. In this case, the task queued for a rendezvous call is removed from the<br />

queue, and its state changes from WAIT on rendezvous call to WAIT for rendezvous completion. The<br />

task issuing tk acp por continues executing.<br />

If there is no task waiting to call a rendezvous at the port designated in porid, or if there is a task<br />

but conditions for establishing a rendezvous are not satisfied, the task issuing tk acp por will enter<br />

WAIT state on rendezvous acceptance for that port. No error results if there is already another task<br />

in WAIT state on rendezvous acceptance at this time; the task issuing tk acp por is placed in the<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!