XenevaOS
Loading...
Searching...
No Matches
Macros
swab.h File Reference
#include <linux/types.h>
#include <linux/stddef.h>
#include <asm/bitsperlong.h>
#include <asm/swab.h>
Include dependency graph for swab.h:
This graph shows which files directly or indirectly include this file:

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

◆ ___constant_swab16

#define ___constant_swab16 (   x)
Value:
((__u16)( \
(((__u16)(x) & (__u16)0x00ffU) << 8) | \
(((__u16)(x) & (__u16)0xff00U) >> 8)))
uint16_t __u16
Definition drm.h:40

◆ ___constant_swab32

#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)))
uint32_t __u32
Definition drm.h:42
int x
Definition layout.c:118

◆ ___constant_swab64

#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)))
uint64_t __u64
Definition drm.h:44

◆ ___constant_swahb32

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

◆ ___constant_swahw32

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

◆ __swab16

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

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

◆ __swab32

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

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

◆ __swab64

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

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

◆ __swahb32

#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 @x: value to byteswap

__swahb32(0x12345678) is 0x34127856

◆ __swahw32

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

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

__swahw32(0x12340000) is 0x00001234