byteorder.h 987 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * linux/include/asm-arm/byteorder.h
  3. *
  4. * Copyright (C) 2011 Andes Technology Corporation
  5. * Shawn Lin, Andes Technology Corporation <nobuhiro@andestech.com>
  6. * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
  7. *
  8. * ARM Endian-ness. In little endian mode, the data bus is connected such
  9. * that byte accesses appear as:
  10. * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
  11. * and word accesses (data or instruction) appear as:
  12. * d0...d31
  13. *
  14. * When in big endian mode, byte accesses appear as:
  15. * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
  16. * and word accesses (data or instruction) appear as:
  17. * d0...d31
  18. */
  19. #ifndef __ASM_NDS_BYTEORDER_H
  20. #define __ASM_NDS_BYTEORDER_H
  21. #include <asm/types.h>
  22. #if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
  23. # define __BYTEORDER_HAS_U64__
  24. # define __SWAB_64_THRU_32__
  25. #endif
  26. #ifdef __NDSEB__
  27. #include <linux/byteorder/big_endian.h>
  28. #else
  29. #include <linux/byteorder/little_endian.h>
  30. #endif
  31. #endif