This is the mail archive of the ecos-discuss@sources.redhat.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]
Other format: [Raw text]

Question about IRQ in eCOS-ARM?


Hi all:
   I tried to follow the vectors.s (ARM) to make myself cleared about the
interrupt handling in eCOS. I was quite confused by the following code.

IRQ:
        // Note: I use this exception stack while saving the context because
        // the current SP does not seem to be always valid in this CPU mode.
        ldr     sp,.__exception_stack   // get good stack
        sub     lr,lr,#4                // PC at time of interrupt
        stmfd   sp!,{r0,fp,ip,lr}
        mrs     r0,spsr
        stmfd   sp!,{r0}

..........................
..........................

IRQ_15A:
#else
        mov     lr,pc                   // invoke handler (call indirect
        mov     pc,v3                   // thru v3)
#endif


It seems at the very beginning of entering the IRQ (while ext irq occurs),
the program saves the interrupted address(lr, before IRQ) into the
__exception_stack.
Then calculates the isr address(not shown in this email), last it  " mov lr,
pc" then set the pc to the isr address. why "mov lr, pc" is needed? And how
, where and when the return address(return to the interrupted address before
IRQ) is restored?

Thanks for your help

james


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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