6 typedef unsigned char u8
;
20 #if __BYTE_ORDER == __BIG_ENDIAN
21 #define swap_be64(a) (a)
22 #define swap_be32(a) (a)
23 #define swap_be16(a) (a)
25 #define swap_be64(a) __swap64(a)
26 #define swap_be32(a) __swap32(a)
27 #define swap_be16(a) __swap16(a)
30 static inline u16
__swap16(u16 a
)
32 return (((a
& 0xff00) >> 8) |
36 static inline u32
__swap32(u32 a
)
38 return (((a
& 0xff000000U
) >> 24) |
39 ((a
& 0x00ff0000U
) >> 8) |
40 ((a
& 0x0000ff00U
) << 8) |
41 ((a
& 0x000000ffU
) << 24));
44 static inline u64
__swap64(u64 a
)
46 return (((a
& 0xff00000000000000ULL
) >> 56) |
47 ((a
& 0x00ff000000000000ULL
) >> 40) |
48 ((a
& 0x0000ff0000000000ULL
) >> 24) |
49 ((a
& 0x000000ff00000000ULL
) >> 8) |
50 ((a
& 0x00000000ff000000ULL
) << 8) |
51 ((a
& 0x0000000000ff0000ULL
) << 24) |
52 ((a
& 0x000000000000ff00ULL
) << 40) |
53 ((a
& 0x00000000000000ffULL
) << 56));
57 #endif /* _CONFIG_H */