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: Interrupts for Arm-elf-gcc


This is what I use. I'd be interested in hearing if anybody has a
simpler solution. In particular, if __attribute__((interrupt)) has been
implemented for arm-elf since I used it last.

Cheers,
Shaun


/**
 * Interrupt service routine.
 */
__attribute__ ((unused))
     static void isr(void)
{
	// your code here
}


/**
 * Dispatch the interrupt service routine.
 */
void isr_dispatch(void);

__asm("\nisr_dispatch:"
      "\n  stmfd sp!, {r0-r3, r12, lr}"
      "\n  bl isr"
      "\n  ldmfd sp!, {r0-r3, r12, lr}"
      "\n  subs pc, lr, #4" "\n");


On Tue, 2003-07-22 at 10:30, David Mc Kenna wrote:
> Hi all,
> 
> How does someone write an interrupt for an ARM,i.e. what directives do I use
> within gcc? 
> 
> Thanks,
> Dave Mc Kenna



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