• Matt Redfearn's avatar
    MIPS: Switch to the irq_stack in interrupts · dda45f70
    Matt Redfearn authored
    When enterring interrupt context via handle_int or except_vec_vi, switch
    to the irq_stack of the current CPU if it is not already in use.
    
    The current stack pointer is masked with the thread size and compared to
    the base or the irq stack. If it does not match then the stack pointer
    is set to the top of that stack, otherwise this is a nested irq being
    handled on the irq stack so the stack pointer should be left as it was.
    
    The in-use stack pointer is placed in the callee saved register s1. It
    will be saved to the stack when plat_irq_dispatch is invoked and can be
    restored once control returns here.
    Signed-off-by: default avatarMatt Redfearn <matt.redfearn@imgtec.com>
    Acked-by: default avatarJason A. Donenfeld <jason@zx2c4.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: James Hogan <james.hogan@imgtec.com>
    Cc: Paul Burton <paul.burton@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/14743/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
    dda45f70
genex.S 12.8 KB