aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/swab.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-13 20:18:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-13 20:18:53 -0400
commit3d6ee36dfb2d40c72071f68173f67c728a0e19f3 (patch)
tree262130e0f3381c3d409817fdc4abec8852f10e7c /arch/arm/include/asm/swab.h
parent0b381a286e5d748b1fd80095d3dd52326819742f (diff)
parent244acb1ba3777c2eb4d33ddc246cab5419656442 (diff)
Merge branch 'late-for-linus' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM update from Russell King: "This is the final round of stuff for ARM, left until the end of the merge window to reduce the number of conflicts. This set contains the ARM part of David Howells UAPI changes, and a fix to the ordering of 'select' statements in ARM Kconfig files (see the appropriate commit for why this happened - thanks to Andrew Morton for pointing out the problem.) I've left this as long as I dare for this window to avoid conflicts, and I regenerated the config patch yesterday, posting it to our mailing list for review and testing. I have several acks which include successful test reports for it. However, today I notice we've got new conflicts with previously unseen code... though that conflict should be trivial (it's my changes vs a one liner.)" * 'late-for-linus' of git://git.linaro.org/people/rmk/linux-arm: ARM: config: make sure that platforms are ordered by option string ARM: config: sort select statements alphanumerically UAPI: (Scripted) Disintegrate arch/arm/include/asm Fix up fairly conflict in arch/arm/Kconfig (the select re-organization vs recent addition of GENERIC_KERNEL_EXECVE)
Diffstat (limited to 'arch/arm/include/asm/swab.h')
-rw-r--r--arch/arm/include/asm/swab.h37
1 files changed, 1 insertions, 36 deletions
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
index b859d82e30ca..537fc9b91889 100644
--- a/arch/arm/include/asm/swab.h
+++ b/arch/arm/include/asm/swab.h
@@ -15,14 +15,8 @@
15#ifndef __ASM_ARM_SWAB_H 15#ifndef __ASM_ARM_SWAB_H
16#define __ASM_ARM_SWAB_H 16#define __ASM_ARM_SWAB_H
17 17
18#include <linux/compiler.h> 18#include <uapi/asm/swab.h>
19#include <linux/types.h>
20 19
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __SWAB_64_THRU_32__
23#endif
24
25#if defined(__KERNEL__)
26#if __LINUX_ARM_ARCH__ >= 6 20#if __LINUX_ARM_ARCH__ >= 6
27 21
28static inline __attribute_const__ __u32 __arch_swahb32(__u32 x) 22static inline __attribute_const__ __u32 __arch_swahb32(__u32 x)
@@ -42,32 +36,3 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
42 36
43#endif 37#endif
44#endif 38#endif
45
46#if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
47static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
48{
49 __u32 t;
50
51#ifndef __thumb__
52 if (!__builtin_constant_p(x)) {
53 /*
54 * The compiler needs a bit of a hint here to always do the
55 * right thing and not screw it up to different degrees
56 * depending on the gcc version.
57 */
58 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
59 } else
60#endif
61 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
62
63 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
64 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
65 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
66
67 return x;
68}
69#define __arch_swab32 __arch_swab32
70
71#endif
72
73#endif