[PATCH v1 2/2] powerpc: Use %y addressing on bitops

Christophe Leroy christophe.leroy at csgroup.eu
Tue Mar 2 19:48:12 AEDT 2021


Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
---
 arch/powerpc/include/asm/bitops.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
index 11847b6a244e..264626b13ea8 100644
--- a/arch/powerpc/include/asm/bitops.h
+++ b/arch/powerpc/include/asm/bitops.h
@@ -70,12 +70,12 @@ static inline void fn(unsigned long mask,	\
 	unsigned long *p = (unsigned long *)_p;	\
 	__asm__ __volatile__ (			\
 	prefix					\
-"1:"	PPC_LLARX "%0,0,%3,0\n"			\
+"1:"	PPC_LLARX "%0,%y3,0\n"			\
 	stringify_in_c(op) "%0,%0,%2\n"		\
-	PPC_STLCX "%0,0,%3\n"			\
+	PPC_STLCX "%0,%y3\n"			\
 	"bne- 1b\n"				\
 	: "=&r" (old), "+m" (*p)		\
-	: "r" (mask), "r" (p)			\
+	: "r" (mask), "Z" (*p)			\
 	: "cc", "memory");			\
 }
 
@@ -115,13 +115,13 @@ static inline unsigned long fn(			\
 	unsigned long *p = (unsigned long *)_p;		\
 	__asm__ __volatile__ (				\
 	prefix						\
-"1:"	PPC_LLARX "%0,0,%3,%4\n"			\
+"1:"	PPC_LLARX "%0,%y3,%4\n"				\
 	stringify_in_c(op) "%1,%0,%2\n"			\
-	PPC_STLCX "%1,0,%3\n"				\
+	PPC_STLCX "%1,%y3\n"				\
 	"bne- 1b\n"					\
 	postfix						\
 	: "=&r" (old), "=&r" (t)			\
-	: "r" (mask), "r" (p), "i" (IS_ENABLED(CONFIG_PPC64) ? eh : 0)	\
+	: "r" (mask), "Z" (*p), "i" (IS_ENABLED(CONFIG_PPC64) ? eh : 0)	\
 	: "cc", "memory");				\
 	return (old & mask);				\
 }
@@ -170,12 +170,12 @@ clear_bit_unlock_return_word(int nr, volatile unsigned long *addr)
 
 	__asm__ __volatile__ (
 	PPC_RELEASE_BARRIER
-"1:"	PPC_LLARX "%0,0,%3,0\n"
+"1:"	PPC_LLARX "%0,%y3,0\n"
 	"andc %1,%0,%2\n"
-	PPC_STLCX "%1,0,%3\n"
+	PPC_STLCX "%1,%y3\n"
 	"bne- 1b\n"
 	: "=&r" (old), "=&r" (t)
-	: "r" (mask), "r" (p)
+	: "r" (mask), "Z" (*p)
 	: "cc", "memory");
 
 	return old;
-- 
2.25.0



More information about the Linuxppc-dev mailing list