aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64/byteorder.h
diff options
context:
space:
mode:
authorGOTO Masanori <gotom@debian.or.jp>2005-06-28 23:45:03 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-29 00:20:32 -0400
commit12822bc272e857544476cef9175462711899008b (patch)
treeb1add1c4c3a152493628302370c72fd3eb06839b /include/asm-ppc64/byteorder.h
parentc016e2257acd00a7ffd87fa1eec896138563d1aa (diff)
[PATCH] headers: enable ppc64 ___arch__swab16 and ___arch__swab32
This patch cleans up asm-ppc64/byteorder.h to enable ___arch__swab16 and ___arch__swab32 which are marked TODO currently. It removes ___arch__swab64 because ppc64 does not have short instruction combinations for swab64, the recent gcc generates enough smart code that is equivalent to hand assembled code under my tests. Signed-off-by: GOTO Masanori <gotom@debian.or.jp> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-ppc64/byteorder.h')
-rw-r--r--include/asm-ppc64/byteorder.h10
1 files changed, 0 insertions, 10 deletions
diff --git a/include/asm-ppc64/byteorder.h b/include/asm-ppc64/byteorder.h
index 80327532de64..8b57da62b674 100644
--- a/include/asm-ppc64/byteorder.h
+++ b/include/asm-ppc64/byteorder.h
@@ -40,7 +40,6 @@ static __inline__ void st_le32(volatile __u32 *addr, const __u32 val)
40 __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); 40 __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
41} 41}
42 42
43#if 0
44static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value) 43static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value)
45{ 44{
46 __u16 result; 45 __u16 result;
@@ -63,17 +62,8 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 value)
63 return result; 62 return result;
64} 63}
65 64
66static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 value)
67{
68 __u64 result;
69#error implement me
70}
71
72#define __arch__swab16(x) ___arch__swab16(x) 65#define __arch__swab16(x) ___arch__swab16(x)
73#define __arch__swab32(x) ___arch__swab32(x) 66#define __arch__swab32(x) ___arch__swab32(x)
74#define __arch__swab64(x) ___arch__swab64(x)
75
76#endif
77 67
78/* The same, but returns converted value from the location pointer by addr. */ 68/* The same, but returns converted value from the location pointer by addr. */
79#define __arch__swab16p(addr) ld_le16(addr) 69#define __arch__swab16p(addr) ld_le16(addr)