summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/byteorder.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
commit27cfca1ec98e91261b1a5355d10a8996464b63af (patch)
tree8e895a53e372fa682b4c0a585b9377d67ed70d0e /include/asm-arm/byteorder.h
parent6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff)
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'include/asm-arm/byteorder.h')
-rw-r--r--include/asm-arm/byteorder.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/asm-arm/byteorder.h b/include/asm-arm/byteorder.h
new file mode 100644
index 000000000..7b232d906
--- /dev/null
+++ b/include/asm-arm/byteorder.h
@@ -0,0 +1,39 @@
+#ifndef __ASM_ARM_BYTEORDER_H
+#define __ASM_ARM_BYTEORDER_H
+
+#include <asm/types.h>
+
+#ifdef __GNUC__
+
+static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
+{
+ unsigned long xx;
+ __asm__("eor\t%1, %0, %0, ror #16\n\t"
+ "bic\t%1, %1, #0xff0000\n\t"
+ "mov\t%0, %0, ror #8\n\t"
+ "eor\t%0, %0, %1, lsr #8\n\t"
+ : "=r" (x), "=&r" (xx)
+ : "0" (x));
+ return x;
+}
+
+static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
+{
+ __asm__("eor\t%0, %0, %0, lsr #8\n\t"
+ "eor\t%0, %0, %0, lsl #8\n\t"
+ "bic\t%0, %0, #0xff0000\n\t"
+ "eor\t%0, %0, %0, lsr #8\n\t"
+ : "=r" (x)
+ : "0" (x));
+ return x;
+}
+
+#define __arch__swab32(x) ___arch__swab32(x)
+#define __arch__swab16(x) ___arch__swab16(x)
+
+#endif /* __GNUC__ */
+
+#include <linux/byteorder/little_endian.h>
+
+#endif
+