1 #ifndef _BLACKFIN_SWAB_H
2 #define _BLACKFIN_SWAB_H
4 #include <linux/types.h>
5 #include <asm-generic/swab.h>
9 static __inline__ __attribute_const__ __u32
__arch_swahb32(__u32 xx
)
12 __asm__("%1 = %0 >> 8 (V);\n\t"
13 "%0 = %0 << 8 (V);\n\t"
15 : "+d"(xx
), "=&d"(tmp
));
18 #define __arch_swahb32 __arch_swahb32
20 static __inline__ __attribute_const__ __u32
__arch_swahw32(__u32 xx
)
23 __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv
): "d"(xx
));
26 #define __arch_swahw32 __arch_swahw32
28 static __inline__ __attribute_const__ __u32
__arch_swab32(__u32 xx
)
30 return __arch_swahb32(__arch_swahw32(xx
));
32 #define __arch_swab32 __arch_swab32
34 static __inline__ __attribute_const__ __u16
__arch_swab16(__u16 xx
)
37 __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw
));
40 #define __arch_swab16 __arch_swab16
44 #endif /* _BLACKFIN_SWAB_H */