Filip Van Rillaer wrote: > Hello, > > Our application is written with some kind of super-loop scheduling : we > have many drivers that call rt_event_signal (when data have been written > to the hardware or new data are available to be processed) and 1 task > that is calling rt_event_wait. After receiving an event, the superloop > task is then reading/writing the data from/to the appropriate > driver. Those calls to the drivers must never block (except to some > locking to protect the consistency of data-structures) to garantuee the > real-time behaviour of the application. > Now we want to communicate with the Linux-domain and thought we have to > use the Xenomai pipe-object for that purpose. > > How can the superloop task in Xenomai receive an event from > the pipe-object when data are available to be read/written (so > without already reading the data)? > > The ideal solution would be if one can ask the pipe-driver to call a > user-callback function when there is a change in the status (read/write) > or an equivalent system to the EPOLL interface (from the uclinux domain). There is a mechanism already available from the core message pipe implementation, but it is not exported by the native API interface. So you have two options: - ask user-space to notify kernel space explicitly _after_ each sending; for that you may even use rt_event_signal() from a plain Linux task to send a specialized event to your superloop. - try the attached patch, which exports the needed bits. It is called rt_pipe_monitor(). Absolutely untested. > > Best regards, > Filip. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Xenomai-help mailing list > Xenomai-help@domain.hid > https://mail.gna.org/listinfo/xenomai-help -- Philippe.