This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM and interrupts


On Fri, Mar 19, 2004 at 02:41:46PM +0100, Toralf Lund wrote:

> BTW, have you written interrupt handlers in C? I'm unsure how to set the 
> functions to make them return the correct way etc., or if that's even
> possible with gcc. The example code uses the __irq keyword (as in "void 
> __irq FIQ_Handler(void)") to do it, but this doesn't work with gcc, I think.

GCC only knows how to generate interrupt handler code for
certain processors (H8, AVR, others?).  Last time I checked ARM
wasn't one of them.  So you'll need to write a small assembly
language wrapper that:

 1) saves the registers that gcc doesn't preserve across
    function calls.

 2) call your C function.

 3) return from interrupt 

-- 
Grant Edwards
grante@visi.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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