clean
[linux-2.4.21-pre4.git] / include / asm-x86_64 / byteorder.h
1 #ifndef _X86_64_BYTEORDER_H
2 #define _X86_64_BYTEORDER_H
3
4 #include <asm/types.h>
5
6 #ifdef __GNUC__
7
8 static __inline__ __const__ __u64 ___arch__swab64(__u64 x)
9 {
10         __asm__("bswapq %0" : "=r" (x) : "0" (x));
11         return x;
12 }
13
14 static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
15 {
16         __asm__("bswapl %0" : "=r" (x) : "0" (x));
17         return x;
18 }
19
20 /* Do not define swab16.  Gcc is smart enought to recognize "C" version and
21    convert it into rotation or exhange.  */
22
23 #define __arch__swab32(x) ___arch__swab32(x)
24 #define __arch__swab64(x) ___arch__swab64(x)
25
26 #endif /* __GNUC__ */
27
28 #define __BYTEORDER_HAS_U64__
29
30 #include <linux/byteorder/little_endian.h>
31
32 #endif /* _X86_64_BYTEORDER_H */