summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/head_32.h
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2019-12-21 08:32:26 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2020-01-26 22:15:09 +1100
commitc9c84fd945bbaadbf69d953be308e6f35737fef6 (patch)
tree8d5cdafe098c7ac3743fcc0673b376aeca765700 /arch/powerpc/kernel/head_32.h
parent5ae8fabc644632d31babbc7162aa876c79aaadb3 (diff)
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 <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/1286b3e51b07727c6b4b05f2df9af3f9b1717fb5.1576916812.git.christophe.leroy@c-s.fr
Diffstat (limited to 'arch/powerpc/kernel/head_32.h')
-rw-r--r--arch/powerpc/kernel/head_32.h11
1 files changed, 11 insertions, 0 deletions
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).