[PATCH v2 08/17] powerpc: Add little endian variants of LWZX_BE and STWX_BE

Christophe Leroy
2024-08-22T07:14:04Z

To support getrandom in VDSO which is based on little endian storage,
add macros equivalent to LWZX_BE and STWX_BE for little endian
accesses.

Put them outside of __powerpc64__ #ifdef so that they can also be used
for PPC32.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
arch/powerpc/include/asm/asm-compat.h | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h
index 2bc53c646ccd..6e53a80917ef 100644
--- a/arch/powerpc/include/asm/asm-compat.h
+++ b/arch/powerpc/include/asm/asm-compat.h
@@ -61,4 +61,12 @@

#endif

+#ifdef __BIG_ENDIAN__
+#define LWZX_LE stringify_in_c(lwbrx)
+#define STWX_LE stringify_in_c(stwbrx)
+#else
+#define LWZX_LE stringify_in_c(lwzx)
+#define STWX_LE stringify_in_c(stwx)
+#endif
+
#endif /* _ASM_POWERPC_ASM_COMPAT_H */
--
2.44.0