|
XenevaOS
|
Utility code for dealing with unaligned memory accesses. More...


Go to the source code of this file.
Utility code for dealing with unaligned memory accesses.
| #define MBEDTLS_BSWAP16 mbedtls_bswap16 |
| #define MBEDTLS_BSWAP32 mbedtls_bswap32 |
| #define MBEDTLS_BSWAP64 mbedtls_bswap64 |
| #define MBEDTLS_BYTE_0 | ( | x | ) | ((uint8_t) ((x) & 0xff)) |
Byte Reading Macros
Given a multi-byte integer x, MBEDTLS_BYTE_n retrieves the n-th byte from x, where byte 0 is the least significant byte.
| #define MBEDTLS_BYTE_1 | ( | x | ) | ((uint8_t) (((x) >> 8) & 0xff)) |
| #define MBEDTLS_BYTE_2 | ( | x | ) | ((uint8_t) (((x) >> 16) & 0xff)) |
| #define MBEDTLS_BYTE_3 | ( | x | ) | ((uint8_t) (((x) >> 24) & 0xff)) |
| #define MBEDTLS_BYTE_4 | ( | x | ) | ((uint8_t) (((x) >> 32) & 0xff)) |
| #define MBEDTLS_BYTE_5 | ( | x | ) | ((uint8_t) (((x) >> 40) & 0xff)) |
| #define MBEDTLS_BYTE_6 | ( | x | ) | ((uint8_t) (((x) >> 48) & 0xff)) |
| #define MBEDTLS_BYTE_7 | ( | x | ) | ((uint8_t) (((x) >> 56) & 0xff)) |
Get the unsigned 16 bits integer corresponding to two bytes in big-endian order (MSB first).
| data | Base address of the memory to get the two bytes from. |
| offset | Offset from data of the first and most significant byte of the two bytes to build the 16 bits unsigned integer from. |
Get the unsigned 16 bits integer corresponding to two bytes in little-endian order (LSB first).
| data | Base address of the memory to get the two bytes from. |
| offset | Offset from data of the first and least significant byte of the two bytes to build the 16 bits unsigned integer from. |
Get the unsigned 24 bits integer corresponding to three bytes in big-endian order (MSB first).
| data | Base address of the memory to get the three bytes from. |
| offset | Offset from data of the first and most significant byte of the three bytes to build the 24 bits unsigned integer from. |
Get the unsigned 24 bits integer corresponding to three bytes in little-endian order (LSB first).
| data | Base address of the memory to get the three bytes from. |
| offset | Offset from data of the first and least significant byte of the three bytes to build the 24 bits unsigned integer from. |
Get the unsigned 32 bits integer corresponding to four bytes in big-endian order (MSB first).
| data | Base address of the memory to get the four bytes from. |
| offset | Offset from data of the first and most significant byte of the four bytes to build the 32 bits unsigned integer from. |
Get the unsigned 32 bits integer corresponding to four bytes in little-endian order (LSB first).
| data | Base address of the memory to get the four bytes from. |
| offset | Offset from data of the first and least significant byte of the four bytes to build the 32 bits unsigned integer from. |
Get the unsigned 64 bits integer corresponding to eight bytes in big-endian order (MSB first).
| data | Base address of the memory to get the eight bytes from. |
| offset | Offset from data of the first and most significant byte of the eight bytes to build the 64 bits unsigned integer from. |
Get the unsigned 64 bits integer corresponding to eight bytes in little-endian order (LSB first).
| data | Base address of the memory to get the eight bytes from. |
| offset | Offset from data of the first and least significant byte of the eight bytes to build the 64 bits unsigned integer from. |
| #define MBEDTLS_IS_BIG_ENDIAN (*((unsigned char *) (&mbedtls_byte_order_detector)) == 0x01) |
Put in memory a 16 bits unsigned integer in big-endian order.
| n | 16 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 16 bits unsigned integer in. |
| offset | Offset from data where to put the most significant byte of the 16 bits unsigned integer n. |
Put in memory a 16 bits unsigned integer in little-endian order.
| n | 16 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 16 bits unsigned integer in. |
| offset | Offset from data where to put the least significant byte of the 16 bits unsigned integer n. |
Put in memory a 24 bits unsigned integer in big-endian order.
| n | 24 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 24 bits unsigned integer in. |
| offset | Offset from data where to put the most significant byte of the 24 bits unsigned integer n. |
Put in memory a 24 bits unsigned integer in little-endian order.
| n | 24 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 24 bits unsigned integer in. |
| offset | Offset from data where to put the least significant byte of the 24 bits unsigned integer n. |
Put in memory a 32 bits unsigned integer in big-endian order.
| n | 32 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 32 bits unsigned integer in. |
| offset | Offset from data where to put the most significant byte of the 32 bits unsigned integer n. |
Put in memory a 32 bits unsigned integer in little-endian order.
| n | 32 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 32 bits unsigned integer in. |
| offset | Offset from data where to put the least significant byte of the 32 bits unsigned integer n. |
Put in memory a 64 bits unsigned integer in big-endian order.
| n | 64 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 64 bits unsigned integer in. |
| offset | Offset from data where to put the most significant byte of the 64 bits unsigned integer n. |
Put in memory a 64 bits unsigned integer in little-endian order.
| n | 64 bits unsigned integer to put in memory. |
| data | Base address of the memory where to put the 64 bits unsigned integer in. |
| offset | Offset from data where to put the least significant byte of the 64 bits unsigned integer n. |