First Support on Ginger and OMAP TI
[linux-ginger.git] / arch / m68k / include / asm / swab.h
blob5b754aace744959af8918e2b94ab3f7351c1ed1c
1 #ifndef _M68K_SWAB_H
2 #define _M68K_SWAB_H
4 #include <linux/types.h>
5 #include <linux/compiler.h>
7 #define __SWAB_64_THRU_32__
9 #if defined (__mcfisaaplus__) || defined (__mcfisac__)
10 static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
12 __asm__("byterev %0" : "=d" (val) : "0" (val));
13 return val;
16 #define __arch_swab32 __arch_swab32
17 #elif !defined(__uClinux__)
19 static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
21 __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val));
22 return val;
24 #define __arch_swab32 __arch_swab32
25 #endif
27 #endif /* _M68K_SWAB_H */