--- 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). As for fiqs, the way I see them is as a way to get some sort of "spare CPU thread" running, ie they are not just high priority interrupts. As an example of what I mean, I have seen fiqs used for "soft dma". If you start using C functions in a fiq, then, IMHO, you've missed the point. In this way, the fiq is entirely written in assembler to keepo it very small and exploit all the special register stuff. If you want to do further processing from a fiq event, then you can use the VICSoftInt function to schedule a regular interrupt for further processing. IMHO. > > > // richard (This email is for mailing lists. To reach me directly, please > use richard at imagecraft.com)
Message
Re: IAR C and FIQ isr
2005-05-06 by embeddedjanitor
Attachments
- No local attachments were found for this message.