Some weeks ago I asked some questions about "sharing IRQ" between RT and
Linux.

In fact, the unique PCI slot on my target share the same PCI IRQ pin as the
ethenet chip embedded on mother board. In wanted to use a PCI board in this
slot from my RTLinux app and use network from Linux.

So I wanted to signal IRQ to Linux after having handled it in my rt irq
handler.

Nobody have realy answered to my questions. So I had to find how to do that.

Maybe will it usefull to someone who have the same problem.

If someone think that there is something wrong, please tell it.

****************************
#include <rtl_sched.h>

static struct sigaction oldact;
static int my_irq=/* Your IRQ*/

void my_irq_handler(int sig)
{
/* Your code here*/
 pthread_kill(pthread_linux(), RTL_LINUX_MIN_SIGNAL+my_irq);
}

int init_module(void)
{
struct sigaction act;

act.sa_handler = my_irq_handler;
act.sa_flags = SA_FOCUS;
act.sa_focus = 1 << rtl_getcpuid();

rtl_hard_disable_irq(my_irq)

if(sigaction (RTL_SIGIRQMIN + my_irq, &act, &oldact)){
 rtl_hard_enable_irq(my_irq);
 return -EAGAIN;
}

rtl_hard_enable_irq(my_irq);
return 0;
}

void cleanup_module(void) {
 sigaction (RTL_SIGIRQMIN + my_irq, &oldact, NULL);
}

****************************

Edouard

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to