<To RTLinux [EMAIL PROTECTED]>

I would like for my RTL interrupt service routine (ISR) to operate
correctly in a shared IRQ environment so that if another device uses
the same IRQ, my ISR won't interfere with its ISR and both will work
properly (assuming the other device also correctly shares the IRQ).

Inside my RTL ISR, I check to see if my device (analog to digital
converter) has an interrupt request pending.  If not, I simply
return(0).

    static unsigned int
    myISR(unsigned int irq, struct pt_regs *regs)
    {
        static int  status;
        
    status = inpw(INTADCFIFO);              // INTERRUPT & PACER CONTROL REGISTER
    
    // CHECK IF THE DAS CARD CAUSED THE INTERRUPT.
    
    if (!(status & 0x0080))                 // DID DAS CAUSE INTERRUPT? (INT bit set?)
        {
        // THIS IS NOT OUR INTERRUPT!
        // Something else generated an interrupt
        // on this IRQ.  In order to support IRQ sharing, we chain to
        // the previous ISR.
        
        
        return(0);                          // ??what is return value used for?
        }
    ...
    ACKNOWLEDGE_CARD;                   // Reset interrupts on card
    rtl_hard_enable_irq(irq);           // Enable CPU interrupts for this IRQ
    return(0);
    }

I'm running RTLinux 2.2.14 with Red Hat 6.1 on a pentium 233 Mhz
with Linux version 2.2.14-rtl2.2 (gcc version egcs-2.91.66
19990314/Linux (egcs-1.1.2 release)) #4

Do I need to do anything else in my RTL code so that my RTL ISR can
correctly support shared interrupts?



-------------------------
Shel Hoffman
-------------------------


-- [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