1 /* $Id: byteorder.h,v 1.1.1.1 2005/04/11 02:50:52 jack Exp $ */
3 #ifndef _CRIS_BYTEORDER_H
4 #define _CRIS_BYTEORDER_H
10 /* we just define these two (as we can do the swap in a single
11 * asm instruction in CRIS) and the arch-independent files will put
12 * them together into ntohl etc.
15 extern __inline__ __const__ __u32 ___arch__swab32(__u32 x)
17 __asm__ ("swapwb %0" : "=r" (x) : "0" (x));
22 extern __inline__ __const__ __u16 ___arch__swab16(__u16 x)
24 __asm__ ("swapb %0" : "=r" (x) : "0" (x));
29 /* defines are necessary because the other files detect the presence
30 * of a defined __arch_swab32, not an inline
33 #define __arch__swab32(x) ___arch__swab32(x)
34 #define __arch__swab16(x) ___arch__swab16(x)
36 #if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
37 # define __BYTEORDER_HAS_U64__
38 # define __SWAB_64_THRU_32__
43 #include <linux/byteorder/little_endian.h>