• Corey Minyard's avatar
    MIPS: Make SAVE_SOME more standard · 9fef6868
    Corey Minyard authored
    Modify the SAVE_SOME macro to look more like a standard
    function, doing the arithmetic for the frame on the SP
    register instead of copying it from K1, and by saving
    the stored EPC from the RA.  This lets the get_frame_info()
    function process this function like any other.  It also
    remove an instruction or two from the kernel entry,
    making it more efficient.
    
    unwind_stack_by_address() has special handling for
    the top of the interrupt stack, but without this change
    unwinding will still fail if you get an interrupt while
    handling an interrupt and try to do a traceback from
    the second interrupt.
    
    This change modifies the get_saved_sp macro to
    optionally store the fetched value right into sp and store the
    old SP value into K0.  Then it's just a matter of subtracting
    the frame from SP and storing the old SP from K0.
    
    This required changing the DADDI workaround a bit, since K0
    holds the SP, we had to use K1 for AT.  But it eliminated
    some of the special handling for the DADDI workaround.
    
    Saving the RA register was moved up to before fetching the
    CP0_EPC register, so the CP0_EPC register could be stored
    into RA and the saved.  This lets the traceback code know
    where RA is actually stored.
    Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/16991/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    9fef6868
stackframe.h 9.75 KB