Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: {To TomW} GCC-Bug in IRQs

2006-03-27 by roger_lynx

--- In lpc2000@yahoogroups.com, Richard Duits <yahoo@...> wrote:
>
> I think VIC_GCCFIX_IRQ_EPILOGUE should be:
> 
> #define VIC_GCCFIX_IRQ_EPILOGUE()       \
>         __asm__ __volatile__(   "       ldmia   sp!, {r0-r12,pc}^       
> \n");
> 
> 
> The "^" tells the arm to copy SPSR to CPSR.
> 
> Richard.
> 
>

Yes, I think you're correct. Since pc is included in the register_list
it is a LDM(3)-type, to copy SPSR of the current mode (SPSR_irq) to
CPSR, "^" is needed. 
ARM ARM pg. A4-34.

Roger
 
> Sten wrote:
> > frankcallaghan9 wrote:
> > >
> > > Hi Guys,
> > > I've just hit this problem in my UART handler, I'm new to the ARM
> > > and haven't used it's asm yet! could one of you ASM gurus
> > > please post the required inline entry/exit code for us dummys
> > > thanks,
> >
> > Hello Frank,
> >
> > if you want to use "manually" written prologue/epilogue instead of a 
> > stub try this:
> >
> > #define 
> > VIC_GCCFIX_IRQ_PROLOGUE()                                        
      \
> >         __asm__ __volatile__(   "       sub     lr, lr, 
> > #4              \n"     \
> >                                 "       stmdb   sp!, 
> > {r0-r12,lr}        \n");
> > #define VIC_GCCFIX_IRQ_EPILOGUE()       \
> >         __asm__ __volatile__(   "       ldmia   sp!, 
> > {r0-r12,pc}        \n");
> >
> > void myIRQ(void) __attribute__((interrupt("IRQ"), naked));
> >
> > void myIRQ(void) {
> >       VIC_GCCFIX_IRQ_PROLOGUE();
> >       /* ... */
> >       VIC_GCCFIX_IRQ_EPILOGUE();
> > }
> >
> >    Sten
> >
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.