diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2009-01-06 14:56:30 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:10:28 -0800 |
commit | af8e24e96facfd42eb12d13c8120e3e95de40aba (patch) | |
tree | 2c29e2311dd66cd333ad911cddc3ebc80ecb3a0c /arch/arm/include/asm/byteorder.h | |
parent | dd8b72c0cc118196984f1bd23beed545d5087872 (diff) | |
download | talos-op-linux-af8e24e96facfd42eb12d13c8120e3e95de40aba.tar.gz talos-op-linux-af8e24e96facfd42eb12d13c8120e3e95de40aba.zip |
arm: introduce asm/swab.h
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm/include/asm/byteorder.h')
-rw-r--r-- | arch/arm/include/asm/byteorder.h | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h index 4fbfb22f65a0..c02b6fc28e1a 100644 --- a/arch/arm/include/asm/byteorder.h +++ b/arch/arm/include/asm/byteorder.h @@ -15,38 +15,7 @@ #ifndef __ASM_ARM_BYTEORDER_H #define __ASM_ARM_BYTEORDER_H -#include <linux/compiler.h> -#include <asm/types.h> - -static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) -{ - __u32 t; - -#ifndef __thumb__ - if (!__builtin_constant_p(x)) { - /* - * The compiler needs a bit of a hint here to always do the - * right thing and not screw it up to different degrees - * depending on the gcc version. - */ - asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x)); - } else -#endif - t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */ - - x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */ - t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */ - x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */ - - return x; -} - -#define __arch__swab32(x) ___arch__swab32(x) - -#if !defined(__STRICT_ANSI__) || defined(__KERNEL__) -# define __BYTEORDER_HAS_U64__ -# define __SWAB_64_THRU_32__ -#endif +#include <asm/swab.h> #ifdef __ARMEB__ #include <linux/byteorder/big_endian.h> |