How RPC is handled by DSP-RPC-POSIX
Let's start by some definitions:
DSP-side application - this is what you're assumed to be currently working on, which you compile with the C6Run script and will work on the DSP.
GPP-side application - sets up the DSP app and starts running it, and then "answers" the RPC requests. C6Run actually generates this for you, so you don't have to worry about anything here.
RPC target - a function which resides somewhere in the GPP side (could be a library, a shared library, your own code, etc.)
DSP-side stub - a little wrapper function which looks identical to the RPC target. it causes the RPC target to be executed with the parameters you passed to it, and returns you the same value it returns. this is what you actually call from the DSP-side. can be produced by the c6runapp-rpcgen tool, or written manually.
GPP-side stub - another little wrapper function on the GPP side, this is what the GPP side application actually calls. this function "knows" how to call the RPC target itself, so it executes that call and gets the result. can be produced by the c6runapp-rpcgen tool, or written manually.
The run of events that occur when you want to do a remote procedure call are as follows:
The buffer carrying a RPC request is structured as follows:
4 NameLen 4 SignatureLen ... 1 +----------+--------+----------------+-------------+----------+---+ | NameLen | Name | SignatureLen | Signature | Params | 0 | +----------+--------+----------------+-------------+----------+---+
NameLen: length of the function name
Name: function name of the GPP-side stub to be executed (observe: NOT the name of the RPC target)
SignatureLen: length of the function signature
Signature: function signature describing how the parameters section will be unpacked
Params: the function parameters, packed without any size promotions or alignment
0: the null-terminating zero signalling the end of the package