All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Non-Real-Time Asynchronous Notification
@ 2008-03-19 22:05 Robert McCullough
  2008-03-20 19:29 ` Jan Kiszka
  0 siblings, 1 reply; 9+ messages in thread
From: Robert McCullough @ 2008-03-19 22:05 UTC (permalink / raw)
  To: xenomai

Hi,

How do I signal an asynchronous notification from a RTDM real-time task to a
non-real-time user-space Linux thread?
Do I use Non-Real-Time Signaling Services (rtdm_nrtsig_init,..)?
If so, how?

Here is the current code that I am trying to port to RTDM.

Current driver code to signal non-real-time Linux thread:

	// If event
	if(event){
		// and signal asynchronous readers 
		if (kmdpr_device->async_queue)
			kill_fasync(&kmdpr_device->async_queue, SIGIO,
POLL_IN);
	}

Current non-real-time Linux thread signal hander:

	// A static function to use for callback by OS
	static void signal_handler_func(int signo)
	{
		l_sighandler->signalHandler(signo);
	}

	void Kmss::startSignalHandler()
	{
		l_sighandler = this;

		struct sigaction action;

		memset(&action, 0, sizeof(action));
		action.sa_handler = signal_handler_func;
		action.sa_flags = 0;//SA_RESTART;

		sigaction(SIGIO, &action, NULL);
		fcntl(_fh, F_SETOWN, getpid());
		fcntl(_fh, F_SETFL, fcntl(_fh, F_GETFL) | FASYNC);
	}

	void Kmss::signalHandler(int signo)
	{
		kmdpr_events_t events;
	
		if (signo==SIGIO)
		{
			/* Process events */
		}
	}

Best regards, 
Rob




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-04-09 18:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-19 22:05 [Xenomai-help] Non-Real-Time Asynchronous Notification Robert McCullough
2008-03-20 19:29 ` Jan Kiszka
2008-03-21 14:57   ` Robert McCullough
2008-03-21 20:09     ` Jan Kiszka
2008-03-31 15:22       ` Robert McCullough
2008-04-01 23:07         ` Jan Kiszka
2008-04-02 13:29           ` Robert McCullough
2008-04-05 15:41             ` Jan Kiszka
2008-04-09 18:31               ` Robert McCullough

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.