|
Pyrogenesis
13997
|
#include "lib/sysdep/cpu.h"Go to the source code of this file.
Macros | |
| #define | LITTLE_ENDIAN 0x4321 |
| #define | BIG_ENDIAN 0x1234 |
| #define | BYTE_ORDER BIG_ENDIAN |
| #define | FOURCC(a, b, c, d) |
| convert 4 characters to u32 (at compile time) for easy comparison. More... | |
| #define | FOURCC_BE(a, b, c, d) |
| big-endian version of FOURCC More... | |
| #define | FOURCC_LE(a, b, c, d) |
| little-endian version of FOURCC More... | |
| #define | FOURCC FOURCC_BE |
| convert 4 characters to u32 (at compile time) for easy comparison. More... | |
| #define | to_le16(x) swap16(x) |
| #define | to_le32(x) swap32(x) |
| #define | to_le64(x) swap64(x) |
| #define | to_be16(x) (x) |
| #define | to_be32(x) (x) |
| #define | to_be64(x) (x) |
Functions | |
| LIB_API u16 | read_le16 (const void *p) |
| read a little-endian number from memory into native byte order. More... | |
| LIB_API u32 | read_le32 (const void *p) |
| LIB_API u64 | read_le64 (const void *p) |
| see read_le16 More... | |
| LIB_API u16 | read_be16 (const void *p) |
| see read_le16 More... | |
| LIB_API u32 | read_be32 (const void *p) |
| LIB_API u64 | read_be64 (const void *p) |
| see read_be16 More... | |
| LIB_API void | write_le16 (void *p, u16 x) |
| see read_be16 More... | |
| LIB_API void | write_le32 (void *p, u32 x) |
| LIB_API void | write_le64 (void *p, u64 x) |
| see write_le16 More... | |
| LIB_API void | write_be16 (void *p, u16 x) |
| see write_le16 More... | |
| LIB_API void | write_be32 (void *p, u32 x) |
| LIB_API void | write_be64 (void *p, u64 x) |
| see write_be16 More... | |
| LIB_API u64 | movzx_le64 (const u8 *p, size_t size) |
| see write_be16 More... | |
| LIB_API u64 | movzx_be64 (const u8 *p, size_t size) |
| LIB_API i64 | movsx_le64 (const u8 *p, size_t size) |
| sign-extend <size> (truncated to 8) bytes of little-endian data to i64, starting at address <p> (need not be aligned). More... | |
| LIB_API i64 | movsx_be64 (const u8 *p, size_t size) |
| LIB_API u16 | swap16 (const u16 x) |
| LIB_API u32 | swap32 (const u32 x) |
| LIB_API u64 | swap64 (const u64 x) |
| #define BIG_ENDIAN 0x1234 |
Definition at line 35 of file byte_order.h.
| #define BYTE_ORDER BIG_ENDIAN |
Definition at line 39 of file byte_order.h.
| #define FOURCC | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) |
convert 4 characters to u32 (at compile time) for easy comparison.
output is in native byte order; e.g. FOURCC_LE can be used instead.
Definition at line 69 of file byte_order.h.
| #define FOURCC FOURCC_BE |
convert 4 characters to u32 (at compile time) for easy comparison.
output is in native byte order; e.g. FOURCC_LE can be used instead.
Definition at line 69 of file byte_order.h.
| #define FOURCC_BE | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) |
| #define FOURCC_LE | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) |
| #define LITTLE_ENDIAN 0x4321 |
Definition at line 34 of file byte_order.h.
| #define to_be16 | ( | x | ) | (x) |
Definition at line 81 of file byte_order.h.
| #define to_be32 | ( | x | ) | (x) |
Definition at line 82 of file byte_order.h.
| #define to_be64 | ( | x | ) | (x) |
Definition at line 83 of file byte_order.h.
| #define to_le16 | ( | x | ) | swap16(x) |
Definition at line 77 of file byte_order.h.
| #define to_le32 | ( | x | ) | swap32(x) |
Definition at line 78 of file byte_order.h.
| #define to_le64 | ( | x | ) | swap64(x) |
Definition at line 79 of file byte_order.h.
Definition at line 196 of file byte_order.cpp.
sign-extend <size> (truncated to 8) bytes of little-endian data to i64, starting at address <p> (need not be aligned).
Definition at line 190 of file byte_order.cpp.
Definition at line 157 of file byte_order.cpp.
see write_be16
zero-extend <size> (truncated to 8) bytes of little-endian data to u64, starting at address <p> (need not be aligned).
Definition at line 148 of file byte_order.cpp.
| LIB_API u16 read_be16 | ( | const void * | p | ) |
see read_le16
read a big-endian number from memory into native byte order.
Definition at line 88 of file byte_order.cpp.
| LIB_API u32 read_be32 | ( | const void * | p | ) |
Definition at line 95 of file byte_order.cpp.
| LIB_API u64 read_be64 | ( | const void * | p | ) |
see read_be16
Definition at line 102 of file byte_order.cpp.
| LIB_API u16 read_le16 | ( | const void * | p | ) |
read a little-endian number from memory into native byte order.
Definition at line 66 of file byte_order.cpp.
| LIB_API u32 read_le32 | ( | const void * | p | ) |
Definition at line 73 of file byte_order.cpp.
| LIB_API u64 read_le64 | ( | const void * | p | ) |
see read_le16
Definition at line 80 of file byte_order.cpp.
Definition at line 33 of file byte_order.cpp.
Definition at line 40 of file byte_order.cpp.
Definition at line 50 of file byte_order.cpp.
| LIB_API void write_be16 | ( | void * | p, |
| u16 | x | ||
| ) |
see write_le16
write a big-endian number to memory in native byte order.
Definition at line 129 of file byte_order.cpp.
| LIB_API void write_be32 | ( | void * | p, |
| u32 | x | ||
| ) |
Definition at line 135 of file byte_order.cpp.
| LIB_API void write_be64 | ( | void * | p, |
| u64 | x | ||
| ) |
see write_be16
Definition at line 141 of file byte_order.cpp.
| LIB_API void write_le16 | ( | void * | p, |
| u16 | x | ||
| ) |
see read_be16
write a little-endian number to memory in native byte order.
Definition at line 110 of file byte_order.cpp.
| LIB_API void write_le32 | ( | void * | p, |
| u32 | x | ||
| ) |
Definition at line 116 of file byte_order.cpp.
| LIB_API void write_le64 | ( | void * | p, |
| u64 | x | ||
| ) |
see write_le16
Definition at line 122 of file byte_order.cpp.
1.8.5