spawner wrote on Monday, January 17, 2011:
Hello,
I downloaded the FreeRTOS port and I made a simple interrupt driven UART. While looking through the example I noticed that the demo defines an InterruptHandler and an InterruptWrapper. The wrapper is declared as an interrupt like this void __attribute__( (interrupt(ipl2), vector(_UART1_VECTOR))) vU1InterruptWrapper( void ); and is defined in a .S file like this:
.set noreorder
.set noat
.ent vU1InterruptWrapper
vU1InterruptWrapper:
portSAVE_CONTEXT
jal vU1InterruptHandler
nop
portRESTORE_CONTEXT
.end vU1InterruptWrapper
The InterruptHandler is a regular function ( void vU1InterruptHandler(void) ). As far as I know, the compiler generates prologue and epilogue for functions with the interrupt attribute (there is an attribute which tells him not to) and I’m worried that what I’m actually getting here, is saving the context twice, and restoring it twice.
Any thoughts?