endian.h File Reference

#include <hn/osdep.h>

Include dependency graph for endian.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Defines

#define SWAP16_ALWAYS(val)
 Defines global macros for byte-swapping.
#define SWAP32_ALWAYS(val)
#define SWAP64_ALWAYS(val)
#define SWAP16_ON_BE(val)   (val)
#define SWAP32_ON_BE(val)   (val)
#define SWAP64_ON_BE(val)   (val)
#define SWAP16_ON_LE(val)   SWAP16_ALWAYS(val)
#define SWAP32_ON_LE(val)   SWAP32_ALWAYS(val)
#define SWAP64_ON_LE(val)   SWAP64_ALWAYS(val)

Define Documentation

#define SWAP16_ALWAYS val   ) 
 

Value:

(                              \
                (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8)  | \
                (((uint16_t) (val) & (uint16_t) 0xff00U) >> 8))
Defines global macros for byte-swapping.

Whenever available, headers provided by host platform are used, but falling back to generic code when none are available.

Definition at line 41 of file endian.h.

#define SWAP16_ON_BE val   )     (val)
 

Definition at line 70 of file endian.h.

Referenced by Utils::putVal().

#define SWAP16_ON_LE val   )     SWAP16_ALWAYS(val)
 

Definition at line 73 of file endian.h.

#define SWAP32_ALWAYS val   ) 
 

Value:

(                                  \
                (((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \
                (((uint32_t) (val) & (uint32_t) 0x0000ff00U) <<  8) | \
                (((uint32_t) (val) & (uint32_t) 0x00ff0000U) >>  8) | \
                (((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24))

Definition at line 45 of file endian.h.

#define SWAP32_ON_BE val   )     (val)
 

Definition at line 71 of file endian.h.

Referenced by Utils::putVal().

#define SWAP32_ON_LE val   )     SWAP32_ALWAYS(val)
 

Definition at line 74 of file endian.h.

Referenced by SchedBase::SchedBase().

#define SWAP64_ALWAYS val   ) 
 

Value:

(                                           \
                (((uint64_t) (val) & (uint64_t) 0x00000000000000ffULL) << 56) |\
                (((uint64_t) (val) & (uint64_t) 0x000000000000ff00ULL) << 40) |\
                (((uint64_t) (val) & (uint64_t) 0x0000000000ff0000ULL) << 24) |\
                (((uint64_t) (val) & (uint64_t) 0x00000000ff000000ULL) <<  8) |\
                (((uint64_t) (val) & (uint64_t) 0x000000ff00000000ULL) >>  8) |\
                (((uint64_t) (val) & (uint64_t) 0x0000ff0000000000ULL) >> 24) |\
                (((uint64_t) (val) & (uint64_t) 0x00ff000000000000ULL) >> 40) |\
                (((uint64_t) (val) & (uint64_t) 0xff00000000000000ULL) >> 56))

Definition at line 51 of file endian.h.

#define SWAP64_ON_BE val   )     (val)
 

Definition at line 72 of file endian.h.

Referenced by Utils::putVal().

#define SWAP64_ON_LE val   )     SWAP64_ALWAYS(val)
 

Definition at line 75 of file endian.h.