This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Example ISR,DSR for ARM AEB-1


k e wrote:
> 
> So, the creation of the ISR in the example you provide
> below will not interfere with the other ISRs?
> Maybe I'm confusing myself by reading the ARM chip
> sheets, but don't all external interrupts cause the
> same IRQ or FIQ to be activated?  And, then it's up
> to the ISR to determine whether or not the external
> interrupt was from ext0 or ext1 or whatever?  Maybe
> the OS is doing more than I thought it was.

Exactly so - when you talk about ISRs in eCos, you are talking about
interrupt handlers where the source of the interrupt has already been
determined (from the interrupt controller). If you wanted direct control of
the IRQ processor interrupt itself (which is what you were thinking about)
we would call that attaching a VSR (Vectored Service Routine) in eCos, and
in that case you would indeed get all external interrupts no matter what the
source.

On the AEB, the decoding is done in hal/aeb/VERSION/src/aeb_misc.c, for
example here's what it is in my code right now for that:

//
// This routine is called to respond to a hardware interrupt (IRQ).  It
// should interrogate the hardware and return the IRQ vector number.
 
int hal_IRQ_handler(void)
{
    // Do hardware-level IRQ handling
    int irq_status, vector;
    HAL_READ_UINT32(CYG_DEVICE_ICTL_IRQSR, irq_status);
    for (vector = 0;  vector < 16;  vector++) {
        if (irq_status & (1<<vector)) return vector;
    }
    return CYGNUM_HAL_INTERRUPT_unused; // This shouldn't happen!
}                                                                                            

Hope this helps,

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]