diff options
Diffstat (limited to 'cpukit/libfs/src')
-rw-r--r-- | cpukit/libfs/src/dosfs/fat.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/cpukit/libfs/src/dosfs/fat.h b/cpukit/libfs/src/dosfs/fat.h index 6b866794e1..8fcd17f926 100644 --- a/cpukit/libfs/src/dosfs/fat.h +++ b/cpukit/libfs/src/dosfs/fat.h @@ -23,11 +23,11 @@ #define __DOSFS_FAT_H__ #include <sys/param.h> +#include <sys/endian.h> #include <string.h> #include <rtems/seterr.h> -#include <rtems/score/cpu.h> #include <errno.h> #include <rtems/bdbuf.h> @@ -56,18 +56,10 @@ extern "C" { * Naming: Ca_b_c, where a: F = from, T = to, b: LE = little-endian, * BE = big-endian, c: W = word (16 bits), L = longword (32 bits) */ - -#if (CPU_BIG_ENDIAN == TRUE) -# define CF_LE_W(v) CPU_swap_u16((uint16_t)(v)) -# define CF_LE_L(v) CPU_swap_u32((uint32_t)(v)) -# define CT_LE_W(v) CPU_swap_u16((uint16_t)(v)) -# define CT_LE_L(v) CPU_swap_u32((uint32_t)(v)) -#else -# define CF_LE_W(v) (v) -# define CF_LE_L(v) (v) -# define CT_LE_W(v) (v) -# define CT_LE_L(v) (v) -#endif +#define CF_LE_W(v) le16toh(v) +#define CF_LE_L(v) le32toh(v) +#define CT_LE_W(v) htole16(v) +#define CT_LE_L(v) htole32(v) #define FAT_HASH_SIZE 2 #define FAT_HASH_MODULE FAT_HASH_SIZE |