Revision | 71d6ba15a556ac56ec08f83d06a5edeb735bc8ec (tree) |
---|---|
Time | 2014-02-23 14:26:29 |
Author | Yoshinori Sato <ysato@user...> |
Commiter | Yoshinori Sato |
add constant_swab*
@@ -42,6 +42,12 @@ | ||
42 | 42 | #define __cpu_to_be16(x) ((__force __be16)(__u16)(x)) |
43 | 43 | #define __be16_to_cpu(x) ((__force __u16)(__be16)(x)) |
44 | 44 | |
45 | +#define ___constant_swab64(x) (___constant_swab32(x >> 32) | \ | |
46 | + ___constant_swab32(x & 0xffffffffUL) << 32) | |
47 | +#define ___constant_swab32(x) (___constant_swab16(x >> 16) | \ | |
48 | + ___constant_swab16(x & 0xffff) << 16) | |
49 | +#define ___constant_swab16(x) ((x >> 8) | ((x & 0xff) << 8)) | |
50 | + | |
45 | 51 | static inline __le64 __cpu_to_le64p(const __u64 *p) |
46 | 52 | { |
47 | 53 | return (__force __le64)__swab64p(p); |