The ELFv2 ABI used on PPC64 differs from the ELFv1 ABI used on PPC32 here.
On PPC64, once there are any parameters that need to be passed on the
stack, space needs to be reserved on the stack to pass all parameters.
Parameters 0-7 are still only passed by register, but if the callee needs
to spill them, it can use the stack space reserved for the corresponding
parameter to do so.
The switch statement is simpler as an if/else, and removing the argp
variable makes the code more symmetric between the register and stack
parameter cases.
This was previously stored either in the CR (ppc64) or LR (ppc32) save
area of the stack, or to one of the parameter save slots.
In either case, the saved value was unused. This value is also passed
to __start_context via r31, so there's no need to pass it on the stack.
The ABI states that sp[0] should point to the previous stack frame, or be
zero if there is no previous stack frame. makecontext previously set this
slot to point to the __start_context function, rather than to a valid
stack frame.