• Paul Mackerras's avatar
    PPC32: Rework signal code and add a swapcontext system call. · 756f1ae8
    Paul Mackerras authored
    The main thing here is that the signal delivery/return code for real-time
    signals has been changed so that the layout of the registers corresponds
    with the new ucontext_t definition being used by glibc.  The old ucontext_t
    didn't have space to actually store the registers, just a pointer to them,
    which made it impossible to implement set/getcontext et al.  The new
    ucontext_t includes a mcontext_t which actually contains space to store
    all of the general, floating pointer and vector registers.
    
    We now also save the altivec registers on signal delivery and restore them
    on return from the signal if the process has ever used altivec (since the
    last exec).
    
    Finally this adds a swapcontext system call.  Swapcontext really needs to be
    done in the kernel since on PPC, only privileged code can set all three of
    CTR, LR and NIA (next instruction address) to arbitrary values.  Also the kernel
    know if the process currently owns the FP and altivec units and can optimize
    in the case where it doesn't.
    756f1ae8
signal.c 17.2 KB