RTAI API 5.1
|
Files | |
file | msg.c |
Message handling functions. | |
Functions | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpc (RT_TASK *task, unsigned long to_do, void *result) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpc_if (RT_TASK *task, unsigned long to_do, void *result) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpc_until (RT_TASK *task, unsigned long to_do, void *result, RTIME time) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpc_timed (RT_TASK *task, unsigned long to_do, void *result, RTIME delay) |
More... | |
RTAI_SYSCALL_MODE int | rt_isrpc (RT_TASK *task) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_return (RT_TASK *task, unsigned long result) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpcx (RT_TASK *task, void *smsg, void *rmsg, int ssize, int rsize) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpcx_if (RT_TASK *task, void *smsg, void *rmsg, int ssize, int rsize) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpcx_until (RT_TASK *task, void *smsg, void *rmsg, int ssize, int rsize, RTIME time) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpcx_timed (RT_TASK *task, void *smsg, void *rmsg, int ssize, int rsize, RTIME delay) |
More... | |
RTAI_SYSCALL_MODE RT_TASK * | rt_returnx (RT_TASK *task, void *msg, int size) |
More... | |
RTAI_SYSCALL_MODE int rt_isrpc | ( | RT_TASK * | task | ) |
Check if sender waits for reply or not.
After receiving a message, by calling rt_isrpc a task can figure out whether the sender task task is waiting for a reply or not. Such an inquiry may be needed when a server task must provide services to both rt_sends (FIXME) and rt_rtcs. No answer is required if the message is sent by an rt_send function or the sender called rt_rpc_timed() or rt_rpc_until() but it is already timed out.
task | pointer to a task structure. |
RTAI_SYSCALL_MODE RT_TASK * rt_return | ( | RT_TASK * | task, |
unsigned long | result | ||
) |
Return (sends) the result back to the task that made the related remote procedure call.
rt_return sends the result result to the task task. If the task calling rt_rpc is not waiting the answer (i.e. killed or timed out) this return message is silently discarded. The returning task tries to release any previously inheredited priority inherediting the highest priority of any rpcing task still waiting for a return, but only if does not own a resource semaphore. In the latter case it will keep the eighest inheredited priority till it has released the resource ownership and no further message is waiting for a return. That means that in the case priority inheritance is coming only from rpced messages the task will return to its base priority when no further message is queued for a return. Such a scheme automatically sets a dynamic priority ceiling in the case priorities are inheredited both from intertask messaging and resource semaphores ownership.
See also: notes under rt_rpc().
Referenced by rt_receive(), rt_receive_if(), and rt_receive_until().
RTAI_SYSCALL_MODE RT_TASK * rt_returnx | ( | RT_TASK * | task, |
void * | msg, | ||
int | size | ||
) |
Return (sends) an extended result back to the task that made the related extended remote procedure call.
rt_returns sends the result msg of size size to the task task. If the task calling rt_rpcx is not waiting the answer (i.e. killed or timed out) this return message is silently discarded. The returning task tries to release any previously inheredited priority inherediting the highest priority of any rpcing task still waiting for a return, but only if does not own a resource semaphore. In the latter case it will keep the eighest inheredited priority till it has released the resource ownership and no further message is waiting for a return. That means that in the case priority inheritance is coming only from rpced messages the task will return to its base priority when no further message is queued for a return. Such a scheme automatically sets a dynamic priority ceiling in the case priorities are inheredited both from intertask messaging and resource semaphores ownership.
See also: notes under rt_rpcx().
RTAI_SYSCALL_MODE RT_TASK * rt_rpc | ( | RT_TASK * | task, |
unsigned long | to_do, | ||
void * | result | ||
) |
Make a remote procedure call
rt_rpc makes a Remote Procedure Call (RPC). rt_rpc is used for synchronous inter task messaging as it sends the message msg to the task task and blocks waiting until a return is received from the called task. So the caller task is always blocked and queued up in priority order while the receiver inheredits the blocked sender priority if it is higher (lower in value) than its. The receiver task may get the message with any rt_receive function. It can send an answer with rt_return().
task | pointer to a RT_TASK structure. |
msg | message to send. |
reply | points to a buffer provided by the caller were the returned result message, any 4 bytes integer, is to be place. |
See also: rt_receive_*, rt_return(), rt_isrpc().
Referenced by rt_rpcx(), and rt_sendx().
RTAI_SYSCALL_MODE RT_TASK * rt_rpc_if | ( | RT_TASK * | task, |
unsigned long | to_do, | ||
void * | result | ||
) |
Make a remote procedure call, only if the calling task will not be blocked.
rt_rpc_if tries to make a Remote Procedure Call (RPC). If the receiver task is ready to accept a message rt_rpc_if sends the message msg then it always block until a return is received. In this case the caller task is blocked and queued up in priority order while the receiver inheredits the blocked sender priority if it is higher (lower in value) than its. If the receiver is not ready rt_rpc_if returns immediately. The receiver task may get the message with any rt_receive function. It can send the answer with rt_return().
task | pointer to a RT_TASK structure. |
msg | message to send. |
reply | points to a buffer provided by the caller. |
See also: notes under rt_rpc().
Referenced by rt_rpcx_if().
RTAI_SYSCALL_MODE RT_TASK * rt_rpc_timed | ( | RT_TASK * | task, |
unsigned long | to_do, | ||
void * | result, | ||
RTIME | delay | ||
) |
Make a remote procedure call with a relative timeout.
rt_rpc_timed makes a Remote Procedure Call. It sends the message msg to the task task then always waits until a return is received or a timeout occurs. So the caller task is always blocked and queued up in priority order while the receiver inheredits the blocked sender priority if it is higher (lower in value) than its. The receiver task may get the message with any rt_receive() function. It can send the answer with rt_return().
task | pointer to a RT_TASK structure. |
msg | message to send. |
reply | points to a buffer provided by the caller. |
delay | is a timeout relative to the current time. |
See also: rt_receive(), rt_return(), rt_isrpc().
References rt_rpc_until().
Referenced by rt_rpcx_timed(), and rt_sendx_timed().
RTAI_SYSCALL_MODE RT_TASK * rt_rpc_until | ( | RT_TASK * | task, |
unsigned long | to_do, | ||
void * | result, | ||
RTIME | time | ||
) |
Make a remote procedure call with an absolute timeout.
rt_rpc_until makes a Remote Procedure Call. It sends the message msg to the task task then always waits until a return is received or a timeout occurs. So the caller task is always blocked and queued up in priority order while the receiver inheredits the blocked sender priority if it is higher (lower in value) than its. The receiver task may get the message with any rt_receive() function. It can send the answer with rt_return().
task | pointer to a RT_TASK structure. |
msg | message to send. |
reply | points to a buffer provided by the caller. |
time | is an absolute timeout value. |
See also: rt_receive(), rt_return(), rt_isrpc().
Referenced by rt_rpc_timed(), rt_rpcx_until(), and rt_sendx_until().
RTAI_SYSCALL_MODE RT_TASK * rt_rpcx | ( | RT_TASK * | task, |
void * | smsg, | ||
void * | rmsg, | ||
int | ssize, | ||
int | rsize | ||
) |
Make an extended remote procedure call
rt_rpcx makes an extended Remote Procedure Call (RPC). rt_rpcx is used for synchronous inter task messaging. It sends an arbitrary smsg of size ssize bytes to the task task then it always blocks waiting until a message, of size rsize bytes at most, is returned in rmsg from the called task. If the returned message is greater tha rsize it will be truncated. So the caller task is always blocked on the receiver priority queue while the receiver inheredits the blocked sender priority if it is higher (lower in value) than its. The receiver task may get the message with any rt_receivex function. It can send an answer with rt_returnx().
task | pointer to the RT_TASK structure of the receiver. |
smsg | points to the message to be sent. |
rmsg | points to the message to be returned by the receiver. |
ssize | size of the message to be sent. |
rsize | maximum allowed size for the message to be received. |
See also: rt_receivex_*, rt_returnx(), rt_isrpc().
References rt_rpc().
RTAI_SYSCALL_MODE RT_TASK * rt_rpcx_if | ( | RT_TASK * | task, |
void * | smsg, | ||
void * | rmsg, | ||
int | ssize, | ||
int | rsize | ||
) |
Make an extended remote procedure call, only if the calling task will not be blocked.
rt_rpcx_if tries to make an extended Remote Procedure Call (RPC). If the receiver task is ready to accept a message rt_rpcx_if sends the message as it will be done by rt_rpcx. If the receiver is not ready rt_rpcx_if returns immediately. The receiver task may get the message with any rt_receivex function. It can send the answer with * rt_returnx().
task | pointer to the RT_TASK structure of the receiver. |
smsg | points to the message to be sent. |
rmsg | points to the message to be returned by the receiver. |
ssize | size of the message to be sent. |
rsize | maximum allowed size for the message to be received. |
See also: notes under rt_rpc().
References rt_rpc_if().
RTAI_SYSCALL_MODE RT_TASK * rt_rpcx_timed | ( | RT_TASK * | task, |
void * | smsg, | ||
void * | rmsg, | ||
int | ssize, | ||
int | rsize, | ||
RTIME | delay | ||
) |
Make an extended remote procedure call with a relative timeout.
rt_rpcx_timed makes an extended Remote Procedure Call (RPC). It sends an arbitrary smsg of size ssize bytes to the task task then it always blocks waiting until a message, of size rsize bytes at most, is returned in rmsg from the called task or a timeout occurs. If the returned message is greater tha rsize it will be truncated. So the caller task is always blocked on the receiver priority queue while the receiver inheredits the blocked sender priority if it is higher (lower in value) than its. The receiver task may get the message with any rt_receivex function. It can send an answer with rt_returnx().
task | pointer to the RT_TASK structure of the receiver. |
smsg | points to the message to be sent. |
rmsg | points to the message to be returned by the receiver. |
ssize | size of the message to be sent. |
rsize | maximum allowed size for the message to be received. |
delay | is the relative timeout. |
See also: rt_receive(), rt_return(), rt_isrpc().
References rt_rpc_timed().
RTAI_SYSCALL_MODE RT_TASK * rt_rpcx_until | ( | RT_TASK * | task, |
void * | smsg, | ||
void * | rmsg, | ||
int | ssize, | ||
int | rsize, | ||
RTIME | time | ||
) |
Make an extended remote procedure call with absolute timeout.
rt_rpcx_until makes an extended Remote Procedure Call (RPC). It sends an arbitrary smsg of size ssize bytes to the task task then it always blocks waiting until a message, of size rsize bytes at most, is returned in rmsg from the called task or a timeout occurs. If the returned message is greater tha rsize it will be truncated. So the caller task is always blocked on the receiver priority queue while the receiver inheredits the blocked sender priority if it is higher (lower in value) than its. The receiver task may get the message with any rt_receivex function. It can send an answer with rt_returnx().
task | pointer to the RT_TASK structure of the receiver. |
smsg | points to the message to be sent. |
rmsg | points to the message to be returned by the receiver. |
ssize | size of the message to be sent. |
rsize | maximum allowed size for the message to be received. |
time | is an absolute timeout value. |
See also: rt_receive(), rt_return(), rt_isrpc().
References rt_rpc_until().