API Reference Manual
1.46.0
|
Macros that check byte order and operations for byte order conversion.
Macros that will give hints to the compiler.
Macros that allow cache line size configuration, check that alignment is a power of two etc.
Macros | |
#define | ODP_ALIGNED(x) __attribute__((__aligned__(x))) |
Defines type/struct/variable alignment in bytes. | |
#define | ODP_PACKED __attribute__((__packed__)) |
Defines type/struct to be packed. | |
#define | ODP_OFFSETOF(type, member) __builtin_offsetof(type, member) |
Returns offset of member in type. | |
#define | ODP_FIELD_SIZEOF(type, member) sizeof(((type *)0)->member) |
Returns sizeof member. | |
#define | ODP_PAGE_SIZE 4096 |
Page size in bytes. | |
#define | ODP_ALIGNED_CACHE ODP_ALIGNED(ODP_CACHE_LINE_SIZE) |
Defines type/struct/variable to be cache line size aligned. | |
#define | ODP_ALIGNED_PAGE ODP_ALIGNED(ODP_PAGE_SIZE) |
Defines type/struct/variable to be page size aligned. | |
#define | ODP_CACHE_LINE_ROUNDUP(x) ((ODP_CACHE_LINE_SIZE) * (((x) + (ODP_CACHE_LINE_SIZE) - 1) / (ODP_CACHE_LINE_SIZE))) |
Round up to cache line size. More... | |
#define | ODP_LITTLE_ENDIAN 1 |
Little endian byte order. | |
#define | ODP_BIG_ENDIAN 0 |
Big endian byte order. | |
#define | ODP_BYTE_ORDER ODP_LITTLE_ENDIAN |
Selected byte order. | |
#define | ODP_LITTLE_ENDIAN_BITFIELD 1 |
Little endian bit field. | |
#define | ODP_BIG_ENDIAN_BITFIELD 0 |
Big endian bit field. | |
#define | ODP_BITFIELD_ORDER ODP_LITTLE_ENDIAN_BITFIELD |
Selected bitfield order. | |
#define | ODP_NORETURN __attribute__((__noreturn__)) |
Define a function that does not return. | |
#define | ODP_WEAK_SYMBOL __attribute__((__weak__)) |
Define a weak symbol This is primarily useful in defining library functions that can be overridden in user code. | |
#define | ODP_HOT_CODE __attribute__((__hot__)) |
Hot code section. | |
#define | ODP_COLD_CODE __attribute__((__cold__)) |
Cold code section. | |
#define | ODP_PRINTF_FORMAT(x, y) __attribute__((format(printf, (x), (y)))) |
Printf format attribute. | |
#define | ODP_UNUSED __attribute__((__unused__)) |
Intentionally unused variables of functions. | |
#define | odp_likely(x) __builtin_expect(!!(x), 1) |
Branch likely taken. | |
#define | odp_unlikely(x) __builtin_expect(!!(x), 0) |
Branch unlikely taken. | |
Typedefs | |
typedef uint16_t | odp_u16le_t |
unsigned 16bit little endian | |
typedef uint16_t | odp_u16be_t |
unsigned 16bit big endian | |
typedef uint32_t | odp_u32le_t |
unsigned 32bit little endian | |
typedef uint32_t | odp_u32be_t |
unsigned 32bit big endian | |
typedef uint64_t | odp_u64le_t |
unsigned 64bit little endian | |
typedef uint64_t | odp_u64be_t |
unsigned 64bit big endian | |
typedef uint16_t | odp_u16sum_t |
unsigned 16bit bitwise | |
typedef uint32_t | odp_u32sum_t |
unsigned 32bit bitwise | |
Functions | |
uint16_t | odp_be_to_cpu_16 (odp_u16be_t be16) |
Convert 16bit big endian to cpu native uint16_t. More... | |
uint32_t | odp_be_to_cpu_32 (odp_u32be_t be32) |
Convert 32bit big endian to cpu native uint32_t. More... | |
uint64_t | odp_be_to_cpu_64 (odp_u64be_t be64) |
Convert 64bit big endian to cpu native uint64_t. More... | |
odp_u16be_t | odp_cpu_to_be_16 (uint16_t cpu16) |
Convert cpu native uint16_t to 16bit big endian. More... | |
odp_u32be_t | odp_cpu_to_be_32 (uint32_t cpu32) |
Convert cpu native uint32_t to 32bit big endian. More... | |
odp_u64be_t | odp_cpu_to_be_64 (uint64_t cpu64) |
Convert cpu native uint64_t to 64bit big endian. More... | |
uint16_t | odp_le_to_cpu_16 (odp_u16le_t le16) |
Convert 16bit little endian to cpu native uint16_t. More... | |
uint32_t | odp_le_to_cpu_32 (odp_u32le_t le32) |
Convert 32bit little endian to cpu native uint32_t. More... | |
uint64_t | odp_le_to_cpu_64 (odp_u64le_t le64) |
Convert 64bit little endian to cpu native uint64_t. More... | |
odp_u16le_t | odp_cpu_to_le_16 (uint16_t cpu16) |
Convert cpu native uint16_t to 16bit little endian. More... | |
odp_u32le_t | odp_cpu_to_le_32 (uint32_t cpu32) |
Convert cpu native uint32_t to 32bit little endian. More... | |
odp_u64le_t | odp_cpu_to_le_64 (uint64_t cpu64) |
Convert cpu native uint64_t to 64bit little endian. More... | |
#define ODP_CACHE_LINE_ROUNDUP | ( | x | ) | ((ODP_CACHE_LINE_SIZE) * (((x) + (ODP_CACHE_LINE_SIZE) - 1) / (ODP_CACHE_LINE_SIZE))) |
Round up to cache line size.
Rounds up the passed value to the next multiple of cache line size (ODP_CACHE_LINE_SIZE). Returns the original value if it is already a multiple of cache line size or zero.
uint16_t odp_be_to_cpu_16 | ( | odp_u16be_t | be16 | ) |
Convert 16bit big endian to cpu native uint16_t.
be16 | big endian 16bit |
uint32_t odp_be_to_cpu_32 | ( | odp_u32be_t | be32 | ) |
Convert 32bit big endian to cpu native uint32_t.
be32 | big endian 32bit |
uint64_t odp_be_to_cpu_64 | ( | odp_u64be_t | be64 | ) |
Convert 64bit big endian to cpu native uint64_t.
be64 | big endian 64bit |
odp_u16be_t odp_cpu_to_be_16 | ( | uint16_t | cpu16 | ) |
Convert cpu native uint16_t to 16bit big endian.
cpu16 | uint16_t in cpu native format |
odp_u32be_t odp_cpu_to_be_32 | ( | uint32_t | cpu32 | ) |
Convert cpu native uint32_t to 32bit big endian.
cpu32 | uint32_t in cpu native format |
odp_u64be_t odp_cpu_to_be_64 | ( | uint64_t | cpu64 | ) |
Convert cpu native uint64_t to 64bit big endian.
cpu64 | uint64_t in cpu native format |
uint16_t odp_le_to_cpu_16 | ( | odp_u16le_t | le16 | ) |
Convert 16bit little endian to cpu native uint16_t.
le16 | little endian 16bit |
uint32_t odp_le_to_cpu_32 | ( | odp_u32le_t | le32 | ) |
Convert 32bit little endian to cpu native uint32_t.
le32 | little endian 32bit |
uint64_t odp_le_to_cpu_64 | ( | odp_u64le_t | le64 | ) |
Convert 64bit little endian to cpu native uint64_t.
le64 | little endian 64bit |
odp_u16le_t odp_cpu_to_le_16 | ( | uint16_t | cpu16 | ) |
Convert cpu native uint16_t to 16bit little endian.
cpu16 | uint16_t in cpu native format |
odp_u32le_t odp_cpu_to_le_32 | ( | uint32_t | cpu32 | ) |
Convert cpu native uint32_t to 32bit little endian.
cpu32 | uint32_t in cpu native format |
odp_u64le_t odp_cpu_to_le_64 | ( | uint64_t | cpu64 | ) |
Convert cpu native uint64_t to 64bit little endian.
cpu64 | uint64_t in cpu native format |