From c9c84fd945bbaadbf69d953be308e6f35737fef6 Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Sat, 21 Dec 2019 08:32:26 +0000 Subject: powerpc/32: add a macro to get and/or save DAR and DSISR on stack. Refactor reading and saving of DAR and DSISR in exception vectors. This will ease the implementation of VMAP stack. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1286b3e51b07727c6b4b05f2df9af3f9b1717fb5.1576916812.git.christophe.leroy@c-s.fr --- arch/powerpc/kernel/head_32.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'arch/powerpc/kernel/head_32.h') diff --git a/arch/powerpc/kernel/head_32.h b/arch/powerpc/kernel/head_32.h index 436ffd862d2a..f19a1ab91fb5 100644 --- a/arch/powerpc/kernel/head_32.h +++ b/arch/powerpc/kernel/head_32.h @@ -144,6 +144,17 @@ RFI /* jump to handler, enable MMU */ .endm +.macro save_dar_dsisr_on_stack reg1, reg2, sp + mfspr \reg1, SPRN_DAR + mfspr \reg2, SPRN_DSISR + stw \reg1, _DAR(\sp) + stw \reg2, _DSISR(\sp) +.endm + +.macro get_and_save_dar_dsisr_on_stack reg1, reg2, sp + save_dar_dsisr_on_stack \reg1, \reg2, \sp +.endm + /* * Note: code which follows this uses cr0.eq (set if from kernel), * r11, r12 (SRR0), and r9 (SRR1). -- cgit v1.2.3