[PATCH v3 13/14] arm: include: swab: use rigth assembly for armv8

Raphael Poggi poggi.raph at gmail.com
Fri Jun 24 05:24:00 PDT 2016


Signed-off-by: Raphael Poggi <poggi.raph at gmail.com>
---
 arch/arm/include/asm/swab.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index 9997ad2..3795437 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -33,7 +33,11 @@ static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
 
 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
 {
+#if __LINUX_ARM_ARCH__ == 8
+	__asm__ ("rev %w0, %w1" : "=r" (x) : "r" (x));
+#else
 	__asm__ ("rev %0, %1" : "=r" (x) : "r" (x));
+#endif
 	return x;
 }
 #define __arch_swab32 __arch_swab32
-- 
2.1.0




More information about the barebox mailing list