[ECOS] Question about IRQ in eCOS-ARM?

HuangQiang jameshq@liverpool.ac.uk
Wed May 15 10:49:00 GMT 2002

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.

        // 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}


        mov     lr,pc                   // invoke handler (call indirect
        mov     pc,v3                   // thru v3)

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


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

More information about the Ecos-discuss mailing list