Adding a reference to registers to setup_call, followed by adding a reference to a stack pointer to each stack_push function, will allow the preempt() function to have an inline portion that sets up the unknowable side of the call, as well as a hidden implementation that saves the old registers, runs the new function and then restores everything.
This will reduce the impact of preempt() when it is seen inlined everywhere. It most likely adds code size where we want to be nimble.
Adding a reference to registers to setup_call, followed by adding a reference to a stack pointer to each stack_push function, will allow the preempt() function to have an inline portion that sets up the unknowable side of the call, as well as a hidden implementation that saves the old registers, runs the new function and then restores everything.
This will reduce the impact of preempt() when it is seen inlined everywhere. It most likely adds code size where we want to be nimble.