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.

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

tk cal por<br />

Call Port for Rendezvous<br />

[C Language Interface]<br />

INT rmsgsz = tk_cal_por ( ID porid, UINT calptn, VP msg, INT cmsgsz, TMO tmout ) ;<br />

[Parameters]<br />

ID porid Rendezvous port ID<br />

UINT calptn Call bit pattern (indicating conditions of the caller)<br />

VP msg Message packet address<br />

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

TMO tmout Timeout designation<br />

[Return Parameters]<br />

INT rmsgsz Reply message size (in bytes)<br />

or Error Code<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)<br />

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

Parameter error ( cmsgsz < 0, cmsgsz > maxcmsz, calptn = 0, value that cannot be<br />

used in msg, 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 />

Issues a rendezvous call for a rendezvous port.<br />

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

to accept a rendezvous at the port designated in porid and rendezvous conditions between that task<br />

and the task issuing this call overlap. In this case, the task waiting to accept the rendezvous enters<br />

READY state while the state of the task issuing tk cal por is WAIT for rendezvous completion. The<br />

task waiting for rendezvous completion is released from WAIT state when the other (accepting) task<br />

executes tk rpl rdv. The tk cal por system call completes at this time.<br />

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

conditions for establishing a rendezvous are not satisfied, the task issuing tk cal por is placed at 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!