byteorder.h 842 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * AVR32 endian-conversion functions.
  3. */
  4. #ifndef __ASM_AVR32_BYTEORDER_H
  5. #define __ASM_AVR32_BYTEORDER_H
  6. #include <asm/types.h>
  7. #include <linux/compiler.h>
  8. #define __BIG_ENDIAN
  9. #define __SWAB_64_THRU_32__
  10. #ifdef __CHECKER__
  11. extern unsigned long __builtin_bswap_32(unsigned long x);
  12. extern unsigned short __builtin_bswap_16(unsigned short x);
  13. #endif
  14. /*
  15. * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
  16. * the result.
  17. */
  18. #if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
  19. static inline __attribute_const__ __u16 __arch_swab16(__u16 val)
  20. {
  21. return __builtin_bswap_16(val);
  22. }
  23. #define __arch_swab16 __arch_swab16
  24. static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
  25. {
  26. return __builtin_bswap_32(val);
  27. }
  28. #define __arch_swab32 __arch_swab32
  29. #endif
  30. #include <linux/byteorder.h>
  31. #endif /* __ASM_AVR32_BYTEORDER_H */