mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] arm: add __bswapsi2 support
@ 2011-01-14 17:10 Jean-Christophe PLAGNIOL-VILLARD
  2011-01-16 10:47 ` Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-01-14 17:10 UTC (permalink / raw)
  To: barebox

32-bit endian conversion

needed by gcc 4.5.1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-17 10:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-14 17:10 [PATCH] arm: add __bswapsi2 support Jean-Christophe PLAGNIOL-VILLARD
2011-01-16 10:47 ` Jean-Christophe PLAGNIOL-VILLARD
2011-01-16 11:12 ` [PATCH 1/1] import swab.h arch implementation form linux v2.3.37 Jean-Christophe PLAGNIOL-VILLARD
2011-01-17 10:28 ` [PATCH] arm: add __bswapsi2 support Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox