libfdt_env.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License, version 2, as
  4. * published by the Free Software Foundation.
  5. *
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. * GNU General Public License for more details.
  10. *
  11. * You should have received a copy of the GNU General Public License
  12. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  13. *
  14. * Copyright IBM Corp. 2008
  15. * Authors: Hollis Blanchard <hollisb@us.ibm.com>
  16. *
  17. */
  18. #ifndef _LIBFDT_ENV_H
  19. #define _LIBFDT_ENV_H
  20. #include "bswap.h"
  21. #ifdef HOST_WORDS_BIGENDIAN
  22. #define fdt32_to_cpu(x) (x)
  23. #define cpu_to_fdt32(x) (x)
  24. #define fdt64_to_cpu(x) (x)
  25. #define cpu_to_fdt64(x) (x)
  26. #else
  27. #define fdt32_to_cpu(x) (bswap_32((x)))
  28. #define cpu_to_fdt32(x) (bswap_32((x)))
  29. #define fdt64_to_cpu(x) (bswap_64((x)))
  30. #define cpu_to_fdt64(x) (bswap_64((x)))
  31. #endif
  32. #endif /* _LIBFDT_ENV_H */