The reason why the exception frame forms on PSP?

Hello experts,


I would like to ask the reason why the exception frame forms on PSP in the Cortex-M architecture.
My understanding is that MSP (Main Stack Pointer) is the interrupt stack pointer and PSP (Porcess Stack Pointer) is the normal (user) stack pointer.
From my little experiences, the exception frame was formed on the interrupt stack.
However, the ARM forms it on the user stack.

Best regards,
Yasuhiko Kouoto.

Parents
  • If one wants to have a number of user processes and swap between them then having the resume information on the user stack makes life much easier - in essence the main work is just loading the new process stack pointer. In fact one needs to set a pending interrupt for when just returning to the process stack to handle some messing with registers properly so it isn't totally straightforward - the callee save registers of the old process need to be saved and those of the new process loaded before resuming it.. Interrupts are normally just nested though and one doesn't swap between them so a single stack is fine for them. Anything similar to a thread is driven by having a series of interrupts for the different stages rather than waiting in interrupt code.

Reply
  • If one wants to have a number of user processes and swap between them then having the resume information on the user stack makes life much easier - in essence the main work is just loading the new process stack pointer. In fact one needs to set a pending interrupt for when just returning to the process stack to handle some messing with registers properly so it isn't totally straightforward - the callee save registers of the old process need to be saved and those of the new process loaded before resuming it.. Interrupts are normally just nested though and one doesn't swap between them so a single stack is fine for them. Anything similar to a thread is driven by having a series of interrupts for the different stages rather than waiting in interrupt code.

Children
More questions in this forum