aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/ppc_asm.h
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2022-09-26 13:40:56 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2022-09-28 19:22:12 +1000
commit8e93fb33c84f68db20c0bc2821334a4c54c3e251 (patch)
tree4059b8f1c36243441e504873b443362531e6a5f7 /arch/powerpc/include/asm/ppc_asm.h
parentpowerpc/64: switch asm helpers from GOT to TOC relative addressing (diff)
downloadlinux-dev-8e93fb33c84f68db20c0bc2821334a4c54c3e251.tar.xz
linux-dev-8e93fb33c84f68db20c0bc2821334a4c54c3e251.zip
powerpc/64: provide a helper macro to load r2 with the kernel TOC
A later change stops the kernel using r2 and loads it with a poison value. Provide a PACATOC loading abstraction which can hide this detail. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220926034057.2360083-5-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/include/asm/ppc_asm.h')
-rw-r--r--arch/powerpc/include/asm/ppc_asm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 9972f3e90c9d..cf6bec9770d6 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -327,6 +327,12 @@ n:
#ifdef __powerpc64__
+#define __LOAD_PACA_TOC(reg) \
+ ld reg,PACATOC(r13)
+
+#define LOAD_PACA_TOC() \
+ __LOAD_PACA_TOC(r2)
+
#define LOAD_REG_IMMEDIATE(reg, expr) __LOAD_REG_IMMEDIATE reg, expr
#define LOAD_REG_IMMEDIATE_SYM(reg, tmp, expr) \