Hi,
I need a clarification regarding functions portSAVE_CONTEXT() & portRESTORE_CONTEXT() for ARM7 for example LPC-2129. These macros can be invoked from any where for example IRQ(timer interrupt) etc… when the processor enters IRQ mode, stack pointer in use will be SP_irq. What I could make out is, while saving the context or restoring, how is the SP_system is accessed for saving or filling the stack pointer to or from TCB. in portRESTORE_CONTEXT() I could understand that the processor mode will be switched to system mode by “SUBS PC, LR, #4” but the stack pointer gets restored before that… could some one please clarify it?