Anthony
Are you sure that you are using the attribute correctly? GCC does support interrupts and it should be more or less the same for all targets.
Here is an example. Please check that your syntax is the same.
void Cpu_Interrupt(void) __attribute__((interrupt)); // forward declare the function as interrupt
void Cpu_Interrupt(void)
{
// Empty interrupt routine
}
If you look at the *.psa file generated by using objdump (or with the debugger)
"objdump -S *.elf"
you should find that the routine will have the RTE.
Here's an example from the HCS12 which I use (I haven't used GCC with the ColdFire yet - here it uses RTI and RTS).
void Cpu_Interrupt(void)
{
5e12: 18 01 ae 2c movw 2c1a _.frame>, 2,-SP
5e16: 1a
5e17: 18 01 ae 2c movw 2c14 _edata>, 2,-SP
5e1b: 14
5e1c: 18 01 ae 2c movw 2c16 _.z>, 2,-SP
5e20: 16
5e21: 18 01 ae 2c movw 2c18 _.xy>, 2,-SP
5e25: 18
5e26: 7f 2c 1a sts 2c1a _.frame>
00005e29 .LM42>:
5e29: 18 05 b1 2c movw 2,SP+, 2c18 _.xy>
5e2d: 18
5e2e: 18 05 b1 2c movw 2,SP+, 2c16 _.z>
5e32: 16
5e33: 18 05 b1 2c movw 2,SP+, 2c14 _edata>
5e37: 14
5e38: 18 05 b1 2c movw 2,SP+, 2c1a _.frame>
5e3c: 1a
5e3d: 0b rti
00005e3e :
}
If I leave away the interrupt attribute declaration the normal subroutine return is used:
void Cpu_Interrupt(void)
{
5e17: 18 01 ae 2c movw 2c1a _.frame>, 2,-SP
5e1b: 1a
5e1c: 7f 2c 1a sts 2c1a _.frame>
00005e1f .LM43>:
5e1f: 18 05 b1 2c movw 2,SP+, 2c1a _.frame>
5e23: 1a
5e24: 3d rts
00005e25 :
}
It is normally easiest to find a small reference project since the GNU documentation is only really understandable when you already know how it works (which I admit to not doing). Then copy how such things are done.
Note also that the interrupt routine is very compiler specific. Which registers (and soft registers) need to be saved must be known and therefore, although writing the interrupt routines in assembler (with a normal subroutine call to the C-code to be executed) is very possible it will also require a reference from a compiled interrupt routine. But to get a compiled interrupt routine reference you will probably have to solve the problem anyway....
Regards
Mark Butcher
www.mjbc.ch