blob: 8f7d0d6b337ab512d0afd6e20cb7b3d9c6646db1 [file] [log] [blame]
San Mehat91638722010-04-06 18:49:49 -07001/****************************************************************************
2 ****************************************************************************
3 ***
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.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12#ifndef _LINUX_SWAB_H
13#define _LINUX_SWAB_H
Ben Cheng4b29af02012-03-07 16:14:53 -080014
San Mehat91638722010-04-06 18:49:49 -070015#include <linux/types.h>
16#include <linux/compiler.h>
17#include <asm/swab.h>
Ben Cheng4b29af02012-03-07 16:14:53 -080018
San Mehat91638722010-04-06 18:49:49 -070019#define ___constant_swab16(x) ((__u16)( (((__u16)(x) & (__u16)0x00ffU) << 8) | (((__u16)(x) & (__u16)0xff00U) >> 8)))
Ben Cheng4b29af02012-03-07 16:14:53 -080020
San Mehat91638722010-04-06 18:49:49 -070021#define ___constant_swab32(x) ((__u32)( (((__u32)(x) & (__u32)0x000000ffUL) << 24) | (((__u32)(x) & (__u32)0x0000ff00UL) << 8) | (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | (((__u32)(x) & (__u32)0xff000000UL) >> 24)))
Ben Cheng4b29af02012-03-07 16:14:53 -080022
San Mehat91638722010-04-06 18:49:49 -070023#define ___constant_swab64(x) ((__u64)( (((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) | (((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) | (((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) | (((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) | (((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) | (((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) | (((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) | (((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56)))
Ben Cheng4b29af02012-03-07 16:14:53 -080024
San Mehat91638722010-04-06 18:49:49 -070025#define ___constant_swahw32(x) ((__u32)( (((__u32)(x) & (__u32)0x0000ffffUL) << 16) | (((__u32)(x) & (__u32)0xffff0000UL) >> 16)))
Ben Cheng4b29af02012-03-07 16:14:53 -080026
San Mehat91638722010-04-06 18:49:49 -070027#define ___constant_swahb32(x) ((__u32)( (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | (((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))
Ben Cheng4b29af02012-03-07 16:14:53 -080028
San Mehat91638722010-04-06 18:49:49 -070029#ifdef __arch_swab16
30#else
31#endif
32#ifdef __arch_swab32
33#else
34#endif
35#ifdef __arch_swab64
36#elif defined(__SWAB_64_THRU_32__)
37#else
38#endif
39#ifdef __arch_swahw32
40#else
41#endif
42#ifdef __arch_swahb32
43#else
44#endif
45#define __swab16(x) (__builtin_constant_p((__u16)(x)) ? ___constant_swab16(x) : __fswab16(x))
46#define __swab32(x) (__builtin_constant_p((__u32)(x)) ? ___constant_swab32(x) : __fswab32(x))
47#define __swab64(x) (__builtin_constant_p((__u64)(x)) ? ___constant_swab64(x) : __fswab64(x))
48#define __swahw32(x) (__builtin_constant_p((__u32)(x)) ? ___constant_swahw32(x) : __fswahw32(x))
49#define __swahb32(x) (__builtin_constant_p((__u32)(x)) ? ___constant_swahb32(x) : __fswahb32(x))
50#ifdef __arch_swab16p
51#else
52#endif
53#ifdef __arch_swab32p
54#else
55#endif
56#ifdef __arch_swab64p
57#else
58#endif
59#ifdef __arch_swahw32p
60#else
61#endif
62#ifdef __arch_swahb32p
63#else
64#endif
65#ifdef __arch_swab16s
66#else
67#endif
68#ifdef __arch_swab32s
69#else
70#endif
71#ifdef __arch_swab64s
72#else
73#endif
74#ifdef __arch_swahw32s
75#else
76#endif
77#ifdef __arch_swahb32s
78#else
San Mehat91638722010-04-06 18:49:49 -070079#endif
80#endif