Docs » Autodocs » exec.library » StackSwap
StackSwap - EXEC supported method of replacing task's stack (V37)
StackSwap(newStack) A0 VOID StackSwap(struct StackSwapStruct *);
This function will, in an EXEC supported manner, swap the stack of your task with the given values in StackSwap. The StackSwapStruct structure will then contain the values of the old stack such that the old stack can be restored. This function is new in V37.
If you do a stack swap, only the new stack is set up. This function does not copy the stack or do anything else other than set up the new stack for the task. It is generally required that you restore your stack before exiting.
newStack - A structure that contains the values for the new upper and lower stack bounds and the new stack pointer. This structure will have its values replaced by those in you task such that you can restore the stack later.
newStack - The structure will now contain the old stack. This means that StackSwap(foo); StackSwap(foo); will effectively do nothing.
AddTask(), RemTask(), <exec/tasks.h>
|