Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
swab.h File Reference
#include <linux/types.h>
#include <linux/compiler.h>
#include <asm/swab.h>

Go to the source code of this file.

Macros

#define ___constant_swab16(x)
 
#define ___constant_swab32(x)
 
#define ___constant_swab64(x)
 
#define ___constant_swahw32(x)
 
#define ___constant_swahb32(x)
 
#define __swab16(x)
 
#define __swab32(x)
 
#define __swab64(x)
 
#define __swahw32(x)
 
#define __swahb32(x)
 

Macro Definition Documentation

#define ___constant_swab16 (   x)
Value:
((__u16)( \
(((__u16)(x) & (__u16)0x00ffU) << 8) | \
(((__u16)(x) & (__u16)0xff00U) >> 8)))

Definition at line 12 of file swab.h.

#define ___constant_swab32 (   x)
Value:
((__u32)( \
(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
(((__u32)(x) & (__u32)0x0000ff00UL) << 8) | \
(((__u32)(x) & (__u32)0x00ff0000UL) >> 8) | \
(((__u32)(x) & (__u32)0xff000000UL) >> 24)))

Definition at line 16 of file swab.h.

#define ___constant_swab64 (   x)
Value:
((__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)))

Definition at line 22 of file swab.h.

#define ___constant_swahb32 (   x)
Value:
((__u32)( \
(((__u32)(x) & (__u32)0x00ff00ffUL) << 8) | \
(((__u32)(x) & (__u32)0xff00ff00UL) >> 8)))

Definition at line 36 of file swab.h.

#define ___constant_swahw32 (   x)
Value:
((__u32)( \
(((__u32)(x) & (__u32)0x0000ffffUL) << 16) | \
(((__u32)(x) & (__u32)0xffff0000UL) >> 16)))

Definition at line 32 of file swab.h.

#define __swab16 (   x)
Value:
(__builtin_constant_p((__u16)(x)) ? \
___constant_swab16(x) : \
__fswab16(x))

__swab16 - return a byteswapped 16-bit value : value to byteswap

Definition at line 99 of file swab.h.

#define __swab32 (   x)
Value:
(__builtin_constant_p((__u32)(x)) ? \
___constant_swab32(x) : \
__fswab32(x))

__swab32 - return a byteswapped 32-bit value : value to byteswap

Definition at line 108 of file swab.h.

#define __swab64 (   x)
Value:
(__builtin_constant_p((__u64)(x)) ? \
___constant_swab64(x) : \
__fswab64(x))

__swab64 - return a byteswapped 64-bit value : value to byteswap

Definition at line 117 of file swab.h.

#define __swahb32 (   x)
Value:
(__builtin_constant_p((__u32)(x)) ? \
___constant_swahb32(x) : \
__fswahb32(x))

__swahb32 - return a high and low byte-swapped 32-bit value : value to byteswap

__swahb32(0x12345678) is 0x34127856

Definition at line 139 of file swab.h.

#define __swahw32 (   x)
Value:
(__builtin_constant_p((__u32)(x)) ? \
___constant_swahw32(x) : \
__fswahw32(x))

__swahw32 - return a word-swapped 32-bit value : value to wordswap

__swahw32(0x12340000) is 0x00001234

Definition at line 128 of file swab.h.