From 0db42c6b23ce26b05b235dbe2e0aa096db194e33 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 1 Nov 2008 22:59:44 +0100 Subject: cris: use the new byteorder headers Acked-by: Jesper Nilsson Signed-off-by: Harvey Harrison --- arch/cris/include/arch-v10/arch/byteorder.h | 10 ++++++---- arch/cris/include/arch-v32/arch/byteorder.h | 6 ++++-- arch/cris/include/asm/byteorder.h | 20 ++++---------------- 3 files changed, 14 insertions(+), 22 deletions(-) (limited to 'arch/cris') diff --git a/arch/cris/include/arch-v10/arch/byteorder.h b/arch/cris/include/arch-v10/arch/byteorder.h index 255b646b7fa8..ffbd6673a098 100644 --- a/arch/cris/include/arch-v10/arch/byteorder.h +++ b/arch/cris/include/arch-v10/arch/byteorder.h @@ -9,18 +9,20 @@ * them together into ntohl etc. */ -static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) +static inline __attribute_const__ __u32 __arch_swab32(__u32 x) { __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); - + return(x); } +#define __arch_swab32 __arch_swab32 -static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) +static inline __attribute_const__ __u16 __arch_swab16(__u16 x) { __asm__ ("swapb %0" : "=r" (x) : "0" (x)); - + return(x); } +#define __arch_swab16 __arch_swab16 #endif diff --git a/arch/cris/include/arch-v32/arch/byteorder.h b/arch/cris/include/arch-v32/arch/byteorder.h index 6ef8fb4a35f2..fb76087fa2d9 100644 --- a/arch/cris/include/arch-v32/arch/byteorder.h +++ b/arch/cris/include/arch-v32/arch/byteorder.h @@ -4,17 +4,19 @@ #include static inline __const__ __u32 -___arch__swab32(__u32 x) +__arch_swab32(__u32 x) { __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x)); return (x); } +#define __arch_swab32 __arch_swab32 static inline __const__ __u16 -___arch__swab16(__u16 x) +__arch_swab16(__u16 x) { __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x)); return (x); } +#define __arch_swab16 __arch_swab16 #endif /* _ASM_CRIS_ARCH_BYTEORDER_H */ diff --git a/arch/cris/include/asm/byteorder.h b/arch/cris/include/asm/byteorder.h index cc8e418cfd14..420c03021343 100644 --- a/arch/cris/include/asm/byteorder.h +++ b/arch/cris/include/asm/byteorder.h @@ -1,26 +1,14 @@ #ifndef _CRIS_BYTEORDER_H #define _CRIS_BYTEORDER_H -#ifdef __GNUC__ +#define __LITTLE_ENDIAN +#define __SWAB_64_THRU_32__ #ifdef __KERNEL__ -#include - -/* defines are necessary because the other files detect the presence - * of a defined __arch_swab32, not an inline - */ -#define __arch__swab32(x) ___arch__swab32(x) -#define __arch__swab16(x) ___arch__swab16(x) -#endif /* __KERNEL__ */ - -#if !defined(__STRICT_ANSI__) || defined(__KERNEL__) -# define __BYTEORDER_HAS_U64__ -# define __SWAB_64_THRU_32__ +# include #endif -#endif /* __GNUC__ */ - -#include +#include #endif -- cgit v1.2.3