After restoring SCP->sc_mask, check for pending signals (newly unblocked);
if any, set SS->context to SCP, clear SS->intr_port, and send sig_post
to the signal thread to deliver the pending signals.
Don't write $1 value into the user stack. Instead, write it into the word
just past SCP->sc_pc; then point $1 at SCP->sc_pc and use `op_sigreturn'
pseudo-instruction to restore the PC and $1 from that.
(struct mach_msg_trap_args): New type.
(trampoline): Function removed.
(_hurd_setup_sighandler): Take struct hurd_sigstate * arg instead of FLAGS
and SIGALTSTACK args; take new flag arg RPC_WAIT; use struct
machine_thread_all_state * for STATE arg.
New declared labels `trampoline', `rpc_wait_trampoline' mark asm code at
end of function (after return).
Add another struct sigcontext * to STACKFRAME after the first one, for the
arg to __sigreturn.
If SS->context is set, fill registers in SCP from that instead of STATE,
and reset SS->INTR_PORT from it.
If RPC_WAIT is set, set up to use rpc_wait_trampoline and frob args to
mach_msg_trap syscall in progress so that it will retry the receive
operation (but not resend!).
{rpc_wait_trampoline, trampoline}: New trampoline code.
(_hurd_rcv_interrupted_p): New function.
(restore_gpr): Use N-1 as subscript into sc_gpr (sc_gpr[0] => $1).
Before general regs, restore from sc_mdlo and sc_mdhi.
Don't treat sp, fp specially; use restore_gpr for them too.
For final return, store user $1 value beyond top of user stack ahead of
time; Then use $1 to hold the user PC, and restore it from the stack in the
delay slot.