GCC 2.8.1 for PowerPC/EABI: interrupt handler
Mark Naumann
naumann@wagoner.sps.mot.com
Thu Jun 25 14:18:00 GMT 1998
Yaroslav:
Which processor are you using? For the 603e, here is the minimal code
needed in the interrupt vector to call an EABI handler...
.org EVT_EXT_INT
# Interrupts are disabled at this point.
# create an isr stack frame before calling C function
stwu r1,-16(r1)
stw r0,12(r1) # save r0
mflr r0
stw r0,20(r1) # save lr
bl _int_isr
# unwind isr stack frame
lwz r0,20(r1) # restore lr
mtlr r0
lwz r0,12(r1) # restore r0
addi r1,r1,16
rfi
This assumes that you know that your interrupt stack can be put on top
of the current user stack. If that is not the case, the code would be
slightly different.
-------------------------------------------------------------------------
Mark W Naumann Networking Systems Division
Motorola, SemiCustom Solutions phone: +01.602.814.4880
1300 N Alma School Rd, CH260 fax: +01.602.814.4058
Chandler AZ 85224 USA email: Mark_Naumann-rysw20@email.mot.com
Yaroslav Domaratski-R35383 <Yaroslav_Domaratski-R35383@email.sps.mot.com> writes:
> Hello,
>
> Is "interrupt" pragma supported for PowerPC/EABI target in GCC 2.8.1?
>
> It seems like I can not force the compiler to generate prologue/epilogue
> code (gcc doe not generate anything):
>
> #pagma interrupt
> void myHandler( void )
> {
> ...
> }
>
> GCC command line:
> $ gcc -c -ansi -g -gdwarf -O0 -fno-omit-frame-pointer -mcpu=505
> -mno-relocatable -meabi -o file.o file.c
>
> If "interrupt" pragma is not supported, then is it possible to use other
> GCC possibilities instead (like command line options, fnction modifiers,
> ...)?
>
> Thanks in advance,
> Yaroslav
More information about the crossgcc
mailing list