1 #ifndef __ASM_SH_BYTEORDER_H
2 #define __ASM_SH_BYTEORDER_H
5 * Copyright (C) 1999 Niibe Yutaka
6 * Copyright (C) 2000, 2001 Paolo Alberelli
8 #include <linux/compiler.h>
9 #include <linux/types.h>
11 static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
28 static inline __attribute_const__ __u16 ___arch__swab16(__u16 x)
43 static inline __u64 ___arch__swab64(__u64 val)
46 struct { __u32 a,b; } s;
50 w.s.b = ___arch__swab32(v.s.a);
51 w.s.a = ___arch__swab32(v.s.b);
55 #define __arch__swab64(x) ___arch__swab64(x)
56 #define __arch__swab32(x) ___arch__swab32(x)
57 #define __arch__swab16(x) ___arch__swab16(x)
59 #if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
60 # define __BYTEORDER_HAS_U64__
61 # define __SWAB_64_THRU_32__
64 #ifdef __LITTLE_ENDIAN__
65 #include <linux/byteorder/little_endian.h>
67 #include <linux/byteorder/big_endian.h>
70 #endif /* __ASM_SH_BYTEORDER_H */