[PATCH] headers: enable ppc64 ___arch__swab16 and ___arch__swab32
authorGOTO Masanori <gotom@debian.or.jp>
Wed, 29 Jun 2005 03:45:03 +0000 (20:45 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 29 Jun 2005 04:20:32 +0000 (21:20 -0700)
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>
include/asm-ppc64/byteorder.h

index 8032753..8b57da6 100644 (file)
@@ -40,7 +40,6 @@ static __inline__ void st_le32(volatile __u32 *addr, const __u32 val)
        __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
 }
 
-#if 0
 static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value)
 {
        __u16 result;
@@ -63,17 +62,8 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 value)
        return result;
 }
 
-static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 value)
-{
-       __u64 result;
-#error implement me
-}
-
 #define __arch__swab16(x) ___arch__swab16(x)
 #define __arch__swab32(x) ___arch__swab32(x)
-#define __arch__swab64(x) ___arch__swab64(x)
-
-#endif
 
 /* The same, but returns converted value from the location pointer by addr. */
 #define __arch__swab16p(addr) ld_le16(addr)