Synchronous Message Passing
kiszka at rts.uni-hannover.de
Fri Oct 8 18:41:49 CEST 2004
Shravan Rayanchu wrote:
> Actually the problem is something like this:
> we are actually developing a MAC layer. So the
> constraint is that user will use Kernel space (via sys
> calls) and call functions like "connect". Sys call
> then, forms the CONNECT-REQUEST and has to give it to
> an RT Task.(In local m/c).
> // I need to have some mechanism of passing this
> request (basically few bytes of data.)
> RT Task will handle the request. The Syscall then HAS
> to wait till it gets a CONNECT-CONFIRM from the RT
> Task (REQUEST and CONFIRM are both structures) and
> then do some processing and the return to the user
> (the outcome of connect request.)
We had to solve a similar problem in RTnet: Synchronous calls of
functions which require real-time context from standard Linux environment.
As a solution, we added the so-called real-time procedure calling
mechanism (RTPC) which works without the help of LXRT (LXRT had some
problems with signals when waiting on real-time resources, and we also
wanted to be able to work with kernel-only schedulers). RTPC is quite
flexible, e.g. you can easily pass arbitrary data structures in a
race-safe way between RT and non-RT contexts.
Have a look at rtnet_rtpc.c, include/rtnet_rtpc.h and its usage within
RTnet (www.rts.uni-hannover.de/rtnet -> cross-reference or source
download). If you copy it, please note the GPL and its potential
implications on your project.
More information about the Rtai