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.

4.5. EXTENDED SYNCHRONIZATION AND COMMUNICATION FUNCTIONS 139<br />

2. Task Y goes to WAIT state on rendezvous call for the rendezvous port designated in porid. The<br />

bit conditions representing the call select conditions in this case are not those given in the calptn<br />

designated by Task Y when it called tk cal por, but those in the calptn designated by Task X<br />

when it called tk fwd por. The state of Task Y goes from WAIT for rendezvous completion back<br />

to WAIT on rendezvous call.<br />

3. Then if a rendezvous for the rendezvous port designated in porid is accepted, a rendezvous is<br />

established between the accepting task and Task Y. Naturally, if there is a task already waiting<br />

to accept a rendezvous on the rendezvous port designated in porid and the rendezvous conditions<br />

are met, executing tk fwd por will immediately cause a rendezvous to be established.<br />

Here too, as with calptn, the message sent to the accepting task when the rendezvous is established<br />

is that designated in tk fwd por by Task X, not that designated in tk cal por by Task Y.<br />

4. After the new rendezvous has completed, the reply message returned to the calling task by<br />

tk rpl rdv is copied to the area designated in the msg parameter passed to tk cal por by Task<br />

Y, not to the area designated in the msg parameter passed to tk fwd por by Task X.<br />

Essentially the following situation:<br />

Executing tk fwd por (porid=portB, calptn=ptnB, msg=mesB)<br />

after tk cal por (porid=portA, calptn=ptnA, msg=mesA)<br />

is the same as the following:<br />

Executing tk cal por (porid=portB, calptn=ptnB, msg=mesB).<br />

Note that it is not necessary to log the history of rendezvous forwarding.<br />

If tk ref tsk is executed for a task that has returned to WAIT on rendezvous call due to tk fwd por<br />

execution, the value returned in tskwait is TTW CAL. Here wid is the ID of the rendezvous port to which<br />

the rendezvous was forwarded.<br />

tk fwd por execution completes immediately; in no case does this system call go to a WAIT state. A<br />

task issuing tk fwd por loses any relationship to the rendezvous port on which the forwarded rendezvous<br />

was established, the forwarding destination (the port designated in porid), and the tasks conducting<br />

rendezvous on these ports.<br />

Error code E PAR is returned if cmsgsz is larger than maxcmsz of the rendezvous port after forwarding.<br />

This error is checked before the rendezvous is forwarded. If this error occurs, the rendezvous is not<br />

forwarded and the rendezvous designated in rdvno is not released.<br />

The send message designated with tk fwd por is copied to another memory space (such as the message<br />

area designated with tk cal por) when tk fwd por is executed. Accordingly, even if the contents of the<br />

message area designated in the msg parameter passed to tk fwd por are changed before the forwarded<br />

rendezvous is established, the forwarded rendezvous will not be affected.<br />

When a rendezvous is forwarded by tk fwd por, maxrmsz of the rendezvous port after forwarding (designated<br />

in porid) must be no larger than maxrmsz of the rendezvous port on which the rendezvous<br />

was established before forwarding. If maxrmsz of the rendezvous port after forwarding is larger than<br />

maxrmsz of the rendezvous port before forwarding, this means the destination rendezvous port was not<br />

suitable, and error code E OBJ is returned. The task calling the rendezvous readies a reply message<br />

receiving area based on the maxrmsz of the rendezvous port before forwarding. If the maximum size for<br />

the reply message increases when the rendezvous is forwarded, this may indicate that an unexpectedly<br />

large reply message is being returned to the calling rendezvous port, which would cause problems. For<br />

this reason a rendezvous cannot be forwarded to a rendezvous port having a larger maxrmsz.<br />

Similarly, cmsgsz indicating the size of the message sent by tk fwd por must be no larger than maxrmsz<br />

of the rendezvous port on which the rendezvous was established before forwarding. This is because it<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!