Files | |
file | msg.c |
Message handling functions. | |
Functions | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpc (RT_TASK *task, unsigned long to_do, void *result) |
Make a remote procedure call | |
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. | |
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. | |
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. | |
RTAI_SYSCALL_MODE int | rt_isrpc (RT_TASK *task) |
Check if sender waits for reply or not. | |
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. | |
RTAI_SYSCALL_MODE RT_TASK * | rt_rpcx (RT_TASK *task, void *smsg, void *rmsg, int ssize, int rsize) |
Make an extended remote procedure call | |
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. | |
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. | |
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. | |
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. |
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. |
Definition at line 652 of file msg.c.
References RT_SCHED_RETURN, and task.
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.
Definition at line 693 of file msg.c.
References CHECK_SENDER_MAGIC, cpuid, dequeue_blocked(), flags, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_RETURN, rt_schedule(), and task.
Here is the call graph for this function:
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.
Definition at line 1537 of file msg.c.
References rt_return(), and task.
Here is the call graph for this function:
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. |
Definition at line 382 of file msg.c.
References CHECK_SENDER_MAGIC, cpuid, enqueue_blocked(), flags, msg_not_sent, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_RECEIVE, RT_SCHED_RETURN, RT_SCHED_RPC, and task.
Here is the call graph for this function:
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. |
Definition at line 462 of file msg.c.
References CHECK_SENDER_MAGIC, cpuid, enqueue_blocked(), flags, msg_not_sent, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_RECEIVE, RT_SCHED_RETURN, and task.
Here is the call graph for this function:
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. |
Definition at line 621 of file msg.c.
References rt_rpc_until(), and task.
Here is the call graph for this function:
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. |
Definition at line 538 of file msg.c.
References CHECK_SENDER_MAGIC, cpuid, enqueue_blocked(), flags, msg_not_sent, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_RECEIVE, RT_SCHED_RETURN, RT_SCHED_RPC, and task.
Here is the call graph for this function:
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. |
Definition at line 1140 of file msg.c.
References rt_rpc(), SET_RPC_MCB, and task.
Here is the call graph for this function:
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. |
Definition at line 1189 of file msg.c.
References rt_rpc_if(), SET_RPC_MCB, and task.
Here is the call graph for this function:
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. |
Definition at line 1297 of file msg.c.
References rt_rpc_timed(), SET_RPC_MCB, and task.
Here is the call graph for this function:
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. |
Definition at line 1243 of file msg.c.
References rt_rpc_until(), SET_RPC_MCB, and task.
Here is the call graph for this function: