Byte order conversion helpers. More...
#include <compiler.h>#include <types.h>#include <arch/byteorder.h>Go to the source code of this file.
Defines | |
Byte Swapping | |
| #define | swab32(x) |
| Swap the order of bytes in a 32-bit word. | |
| #define | swab16(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff)) |
| Swap the order of bytes in a 16-bit word. | |
Conversion to/from Little Endian values | |
|
| |
| #define | LE16(x) ((le16_t __force)(x)) |
| Create a 16-bit little endian constant. | |
| #define | LE32(x) ((le32_t __force)(x)) |
| Create a 32-bit little endian constant. | |
| static uint16_t | le16_to_cpu (le16_t x) |
| Convert a 16-bit word from little endian to native byte order. | |
| static uint32_t | le32_to_cpu (le32_t x) |
| Convert a 32-bit word from little endian to native byte order. | |
| static le16_t | cpu_to_le16 (uint16_t x) |
| Convert a 16-bit word from native to little endian byte order. | |
| static le32_t | cpu_to_le32 (uint32_t x) |
| Convert a 32-bit word from native to little endian byte order. | |
Conversion to/from Big Endian values | |
|
| |
| #define | BE16(x) |
| Create a 16-bit big endian constant. | |
| #define | BE32(x) |
| Create a 32-bit big endian constant. | |
| static uint16_t | be16_to_cpu (be16_t x) |
| Convert a 16-bit word from big endian to native byte order. | |
| static uint32_t | be32_to_cpu (be32_t x) |
| Convert a 32-bit word from big endian to native byte order. | |
| static be16_t | cpu_to_be16 (uint16_t x) |
| Convert a 16-bit word from native to big endian byte order. | |
| static be32_t | cpu_to_be32 (uint32_t x) |
| Convert a 32-bit word from native to big endian byte order. | |
Byte order conversion helpers.
Copyright (C) 2009 Atmel Corporation. All rights reserved.
Definition in file byteorder.h.
1.6.3