GCC for embedded PowerPC systems

Ian Lance Taylor ian@wasabisystems.com
Tue Sep 28 14:33:00 GMT 2004


Michael Rausch <marausch@inwind.it> writes:

> The direcive is of course "#pragma interrupt".
> I expected it to instruct the compiler to generate a "return from
> interrupt" instruction at the end of the routine, instead of a "return
> from subroutine".
> This is what happens for the SH2.
> The PowerPC actually has a "rfi" instruction, but the compiler
> silently ignores the directive; the generated assembly code is the
> same and there is no "rfi" at the end of the routine.

I don't see any support for #pragma interrupt in the PowerPC backend.
I support for it in the SH backend, with a comment saying "Handle
machine specific pragmas to be semi-compatible with Renesas compiler."
I see the "interrupt" and "interrupt_handler" function attributes
documented here:
    http://gcc.gnu.org/onlinedocs/gcc-3.4.2/gcc/Function-Attributes.html#Function-Attributes
but the documentation does not indicate that they are supported on the
PowerPC.

Basically, I don't think there is any special support in the compiler
for interrupt routines on the PowerPC.  I assume most people just
write the routines, or at least the wrappers, in assembly code.

Ian



More information about the Gcc-help mailing list