Yahoo Groups archive

Lpc2000

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

Message

Re: [lpc2000] Re: IAR C and FIQ isr

2005-05-06 by Robert Adsett

At 03:32 AM 5/6/05 +0000, embeddedjanitor wrote:
>--- In lpc2000@yahoogroups.com, Richard <richard-lists@i...> wrote:
> > At 06:31 AM 5/5/2005, Robert Adsett wrote:
> > >...
> > > >But fiq has own shadow registers r8-r15.
> > > >Why compiler saves this registers in stack?
> > > >I think, that this is not necessary and make undesirable
>overhead.
> > > >Can I avoid this somehow?
> > >
> > >Never trust the compiler for this sort of work.  Do it in
>assembler.  I've
> > >run into too many compilers with either poor or outright broken
>code
> > >generation in this area to ever rely on it.
> > >
> > >Robert
> >
> > That's kind of sad statement to make.
>
>That might seem sad and cynical, but I think it is true.
>
>THose compilers that generate ISR wrappers with prgmas etc only cater
>for a limited interrupt handling model. To get a reliable system you
>are far better off doing all the interrupt wrapping yourself in
>assembly, then calling regular C functions (without wierd attributes).
>This gives you more flexibility (different irq models), better
>portability (between compilers) and better maintainability (more
>predictable, not subject to problems with different versions of
>compilers).

Well put.  In the end compiler writers have limited resources to develop 
and test.  If I have a choice about where I want them to put their efforts 
it's in basic code generation.  Interrupt epilogue and prologue (or task 
switching or machine register access or.... ) are easily handled in 
assembly leaving the bulk of the code to standard C or C++ code.

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

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.