init from v2.6.32.60
[mach-moxart.git] / arch / cris / include / arch-v10 / arch / swab.h
blobe4e847d8a05e5099f4c7900c8590259096b65d1c
1 #ifndef _CRIS_ARCH_SWAB_H
2 #define _CRIS_ARCH_SWAB_H
4 #include <asm/types.h>
5 #include <linux/compiler.h>
7 #define __SWAB_64_THRU_32__
9 /* we just define these two (as we can do the swap in a single
10 * asm instruction in CRIS) and the arch-independent files will put
11 * them together into ntohl etc.
14 static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
16 __asm__ ("swapwb %0" : "=r" (x) : "0" (x));
18 return(x);
20 #define __arch_swab32 __arch_swab32
22 static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
24 __asm__ ("swapb %0" : "=r" (x) : "0" (x));
26 return(x);
28 #define __arch_swab16 __arch_swab16
30 #endif