1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _LINUX_BYTEORDER_SWABB_H
13 #define _LINUX_BYTEORDER_SWABB_H
15 #define ___swahw32(x) ({ __u32 __x = (x); ((__u32)( (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) | (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) )); })
16 #define ___swahb32(x) ({ __u32 __x = (x); ((__u32)( (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) )); })
18 #define ___constant_swahw32(x) ((__u32)( (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | (((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
19 #define ___constant_swahb32(x) ((__u32)( (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
21 #ifndef __arch__swahw32
22 #define __arch__swahw32(x) ___swahw32(x)
24 #ifndef __arch__swahb32
25 #define __arch__swahb32(x) ___swahb32(x)
28 #ifndef __arch__swahw32p
29 #define __arch__swahw32p(x) __swahw32(*(x))
31 #ifndef __arch__swahb32p
32 #define __arch__swahb32p(x) __swahb32(*(x))
35 #ifndef __arch__swahw32s
36 #define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
38 #ifndef __arch__swahb32s
39 #define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
42 #if defined(__GNUC__) && defined(__OPTIMIZE__)
43 #define __swahw32(x) (__builtin_constant_p((__u32)(x)) ? ___swahw32((x)) : __fswahw32((x)))
44 #define __swahb32(x) (__builtin_constant_p((__u32)(x)) ? ___swahb32((x)) : __fswahb32((x)))
46 #define __swahw32(x) __fswahw32(x)
47 #define __swahb32(x) __fswahb32(x)
50 #ifdef __BYTEORDER_HAS_U64__