diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-23 08:06:41 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-01-24 08:39:22 +0100 |
commit | 2711914f828d19d726d3b2d9cda401352b626fc2 (patch) | |
tree | 00304bdca9afa49e5edb28f4c951f00a29698060 /cpukit/libfs/src/dosfs/fat.h | |
parent | Provide <endian.h> for glibc compatibility (diff) | |
download | rtems-2711914f828d19d726d3b2d9cda401352b626fc2.tar.bz2 |
Use <sys/endian.h>
Update #2803.
Diffstat (limited to '')
-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 |