swab.h 478 B

123456789101112131415161718192021222324
  1. #ifndef _ASM_CRIS_ARCH_SWAB_H
  2. #define _ASM_CRIS_ARCH_SWAB_H
  3. #include <asm/types.h>
  4. #define __SWAB_64_THRU_32__
  5. static inline __const__ __u32
  6. __arch_swab32(__u32 x)
  7. {
  8. __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x));
  9. return (x);
  10. }
  11. #define __arch_swab32 __arch_swab32
  12. static inline __const__ __u16
  13. __arch_swab16(__u16 x)
  14. {
  15. __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x));
  16. return (x);
  17. }
  18. #define __arch_swab16 __arch_swab16
  19. #endif /* _ASM_CRIS_ARCH_SWAB_H */