libfdt_env.h 502 B

12345678910111213141516171819202122
  1. #ifndef _LIBFDT_ENV_H
  2. #define _LIBFDT_ENV_H
  3. #include <stddef.h>
  4. #include <stdint.h>
  5. #include <string.h>
  6. #include <endian.h>
  7. #include <byteswap.h>
  8. #if __BYTE_ORDER == __BIG_ENDIAN
  9. #define fdt32_to_cpu(x) (x)
  10. #define cpu_to_fdt32(x) (x)
  11. #define fdt64_to_cpu(x) (x)
  12. #define cpu_to_fdt64(x) (x)
  13. #else
  14. #define fdt32_to_cpu(x) (bswap_32((x)))
  15. #define cpu_to_fdt32(x) (bswap_32((x)))
  16. #define fdt64_to_cpu(x) (bswap_64((x)))
  17. #define cpu_to_fdt64(x) (bswap_64((x)))
  18. #endif
  19. #endif /* _LIBFDT_ENV_H */