byteswap.h 530 B

1234567891011121314151617181920
  1. #ifndef _ASM_BITS_BYTESWAP_H
  2. #define _ASM_BITS_BYTESWAP_H 1
  3. /* CRIS specific byte swap operations: 16, 32 and 64-bit */
  4. #define __bswap_non_constant_16(x) \
  5. __extension__ \
  6. ({ unsigned short __bswap_16_v; \
  7. __asm__ ("swapb %0" : "=r" (__bswap_16_v) : "0" (x)); \
  8. __bswap_16_v; })
  9. #define __bswap_non_constant_32(x) \
  10. __extension__ \
  11. ({ unsigned int __bswap_32_v; \
  12. __asm__ ("swapwb %0" : "=r" (__bswap_32_v) : "0" (x)); \
  13. __bswap_32_v; })
  14. #endif
  15. #include <bits/byteswap-common.h>