Hello Pascal,

I beleive the problem comes from the fact that you are calling the
Linux interrupt handler from within an RTAI handler. Since Linux
interrupt handlers might call on lock mechanisms redirected by
RTAI, this is where things get messy.

Rather than using rt_request_global_irq(), try using rt_request_linux_irq().
What this will do is add your handler to the list of handlers linux
will call when the IRQ happens. Therefore, the normal handler gets
called and so does yours. Your handler can then use RTAI locking
mechanisms to do it's work.

This is actually currently used from within the RTAI schedulers to
try recovering lost jiffies (this is from start_rt_timer in the upscheduler):
rt_request_linux_irq(TIMER_8254_IRQ, recover_jiffies, "rtai_sched", recover_jiffies);

The recover_jiffies function now gets called every time a timer
interrupt gets to Linux.

J'espere que ca pourra vous aider ...

Karim

Pascal Charest wrote:
> 
> Hi,
> 
> I'm trying to catch interruptions with rtai and forcing the linux
> interrupt handler, but I don't know how to do it correctly.  In fact, I
> want to use different drivers with my rt_process and to make them
> realtime without changing their code.  There is a example of what I want
> to do :
> 
> void handler(int irq)
> {
>         ... forcing linux interrupt handler
>         ... doing my own work
> }
> 
> int init_module()
> {
>         ...
>     rt_request_global_irq(IRQ, (void*)handler);
>     rt_startup_irq(IRQ);
>         ...
> }
> 
> When I try something, linux stops or the computer restarts when the
> interrupt occurs ; it depends of the rt fonctions I use in my handler.
> Do someone know how to do it?
> 
> Thanks in  advance,
> 
> Pascal Charest
> -- [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/rtlinux/

-- 
===================================================
                 Karim Yaghmour
               [EMAIL PROTECTED]
          Operating System Consultant
 (Linux kernel, real-time and distributed systems)
===================================================
-- [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/rtlinux/

Reply via email to