12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef _HV_VOS_ENDIAN_H
- #define _HV_VOS_ENDIAN_H
- #include "hv_vos_Types.h"
- VOS_EXTERN_C_BEGIN
-
- #ifndef HV_SWAP32
- #define HV_SWAP32(x) \
- ( \
- (((x) >> 24) & 0xFF ) | \
- (((x) >> 8) & 0xFF00) | \
- (((x) & 0xFF00) << 8 ) | \
- (((x) & 0xFF) << 24 ) \
- )
-
- #endif
- #ifndef HV_SWAP16
- #define HV_SWAP16(x) \
- ( \
- (((x) & 0xFF) << 8 ) | \
- (((x) & 0xFF00) >> 8 ) \
- )
- #endif
- #ifndef HV_SWAP32_INPLACE
- #ifdef HV_CONFIG_ENDIAN_LITTLE
- #define HV_SWAP32_INPLACE(addr) HV_W32((addr), HV_SWAP32(HV_R32(addr)))
- #else
- #define HV_SWAP32_INPLACE(addr) HV_W32_BE((addr), HV_SWAP32(HV_R32_BE(addr)))
- #endif
- #endif
- VOS_EXTERN_C_END
- #endif
|