How to Use Interrupts in Applications

Robert S. Grimes rsg at alum.mit.edu
Wed Jul 25 12:53:06 UTC 2007


Okay, I'm confused.  I'm not at all sure how the concepts of "old
exception model", "new exception model", and the RTEMS "Interrupt
Manager" are related.

One guess I have is that the first two are strictly BSP constructs, and
that the Interrupt Manager sits on top of whichever choice a BSP has
implemented.  Is that correct?

I'm using the PowerPC/Virtex BSP off the head, which uses the "new
exception model".  I want to create a relatively simple ISR to handle a
peripheral that is custom to one of several processor boards that all
use the same BSP.  So it seems wise to keep it out of the BSP, and
implement it in my application.  So do I just use the "Interrupt
Manager", and let all the details pertaining to the interrupt controller
be handled by the BSP?

Is it as simple as this?

    extern rtems_isr_entry myIsrFunc;
    #define MY_INT_VECTOR  1

    // Somewhere in my app init code
    rtems_isr_entry oldIsrFunc;
    rtems_interrupt_catch(myIsrFunc, MY_INT_VECTOR, &oldIsrFunc);

Will the interrupt be properly enabled after the call to
rtems_interrupt_catch?

What about clearing the interrupt in the controller itself - is that a
BSP function automatically handled, or do I need to do it in my ISR?

Sorry if some of this seems too trivial, but I can't find the answers in
the "RTEMS C User's Guide" or the Wiki.  I'm about to try experimenting
and code spelunking, but given the complexities of interrupts, I thought
I'd ask too!

Thanks,
-Bob



More information about the users mailing list