This source file includes following definitions.
- __arch_swab32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #ifndef _UAPI__ASM_ARM_SWAB_H
17 #define _UAPI__ASM_ARM_SWAB_H
18
19 #include <linux/compiler.h>
20 #include <linux/types.h>
21
22 #if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
23 # define __SWAB_64_THRU_32__
24 #endif
25
26
27 #if !defined(__KERNEL__) || __LINUX_ARM_ARCH__ < 6
28 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
29 {
30 __u32 t;
31
32 #ifndef __thumb__
33 if (!__builtin_constant_p(x)) {
34
35
36
37
38
39 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
40 } else
41 #endif
42 t = x ^ ((x << 16) | (x >> 16));
43
44 x = (x << 24) | (x >> 8);
45 t &= ~0x00FF0000;
46 x ^= (t >> 8);
47
48 return x;
49 }
50 #define __arch_swab32 __arch_swab32
51
52 #endif
53
54 #endif