Following the discussion from another thread (was OT there).
I’m porting the freertos on a freescale MAC7111.
I started from the Philips LPC2106 GCC port and the main problem I encountered was the different interrupt controller. It’s vectored but I have to read the source by software. I can’t jump directly to the proper ISR, but to a single ISR in which i read a register in which there is the interrupt source (63 sources), and then jump to the corresponding function.
So, for example, the 2106 port handles differently the preemptivetick (savecontext/restorecontext naked function) and serialISR (savecontext/restore + switchingisr) functions. The microcontroller jumps directly to the correct ISR depending on the interrupt.
In my case i jump into a function (IRQ_ISR), in which I must save the context, and then jump to the proper ISR. This single ISR is defined naked and all the context is saved/restored. the jump is made as a normal function call (using the IRQ stack) and, if for example, I’m in the serialISR, I do a portENTER_SWITCHING_ISR() in which I don’t save the context but only do the sub r11,#4 , as the savecontext was already done in the IRQ_ISR.
So, every IRQ that I raise in my application causes a save/restore context.
Is it right?
Can someone suggest a better approach?