[PATCH] arm: add __bswapsi2 support
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Fri Jan 14 12:10:41 EST 2011
32-bit endian conversion
needed by gcc 4.5.1
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
arch/arm/lib/Makefile | 1 +
arch/arm/lib/_bswapsi2.S | 14 ++++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/lib/_bswapsi2.S
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 89cb72b..56818e8 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -12,6 +12,7 @@ obj-y += lib1funcs.o
obj-y += ashrdi3.o
obj-y += ashldi3.o
obj-y += lshrdi3.o
+obj-y += _bswapsi2.o
obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memcpy.o
obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memset.o
diff --git a/arch/arm/lib/_bswapsi2.S b/arch/arm/lib/_bswapsi2.S
new file mode 100644
index 0000000..7f45fa5
--- /dev/null
+++ b/arch/arm/lib/_bswapsi2.S
@@ -0,0 +1,14 @@
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+
+ENTRY(__bswapsi2)
+#if __LINUX_ARM_ARCH__ <= 5
+ eor r1, r0, r0, ror #16
+ bic r1, r1, #0xff0000
+ mov r0, r0, ror #8
+ eor r0, r0, r1, lsr #8
+#else
+ rev r0, r0
+#endif
+ bx lr
+ENDPROC(__bswapsi2)
--
1.7.2.3
More information about the barebox
mailing list