[OpenBIOS] [PATCH 2/4] ppc: add new context handler

Segher Boessenkool segher at kernel.crashing.org
Wed May 4 21:07:06 CEST 2016


On Wed, May 04, 2016 at 07:54:03PM +0100, Mark Cave-Ayland wrote:
> > And the bl clobbers at least r4,r5.
> 
> I'm sorry but I still don't understand? __switch_context loads a
> completely new CPU state from the stack in order to switch context so
> actually every single register gets clobbered. But we preserve the
> original link register in a local variable to ensure that we can jump
> back to where we were upon return.

If your asm clobbers all regs, the asm needs to say it does.

So this function clobbers all callee-save registers, but you want it
to return to the caller anyway?  And that is expected to work?


Segher



More information about the OpenBIOS mailing list