Thread (17 messages) flat view 17 messages, 4 authors, 2022-09-23

Re: [RFC PATCH 2/7] powerpc/64: abstract asm global variable declaration and access

From: Christophe Leroy <hidden>
Date: 2022-09-21 16:52:38


Le 19/09/2022 à 16:01, Nicholas Piggin a écrit :
Use asm helpers to access global variables and to define them in asm.
Stop using got addressing and use the more common @toc offsets. 32-bit
already does this so that should be unchanged.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/boot/ppc_asm.h b/arch/powerpc/boot/ppc_asm.h
index 192b97523b05..ea290bf78fb2 100644
--- a/arch/powerpc/boot/ppc_asm.h
+++ b/arch/powerpc/boot/ppc_asm.h
@@ -84,4 +84,8 @@
  #define MFTBU(dest)			mfspr dest, SPRN_TBRU
  #endif
  
+#define LOAD_REG_ADDR(reg,name)			\
+	addis	reg,r2,name@toc@ha;		\
+	addi	reg,reg,name@toc@l
+
  #endif /* _PPC64_PPC_ASM_H */
Wouldn't it be better as a GAS macro ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help