From aa0effbd1c0269ce7dd13be8dbf13e6b04f30ebd Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Tue, 13 Jan 2009 19:31:29 -0800 Subject: cris: introduce asm/swab.h Adjust the arch overrides to the new names as well. Signed-off-by: Harvey Harrison Signed-off-by: Linus Torvalds --- arch/cris/include/arch-v10/arch/byteorder.h | 26 ------------------------- arch/cris/include/arch-v10/arch/swab.h | 30 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 26 deletions(-) delete mode 100644 arch/cris/include/arch-v10/arch/byteorder.h create mode 100644 arch/cris/include/arch-v10/arch/swab.h (limited to 'arch/cris/include/arch-v10') diff --git a/arch/cris/include/arch-v10/arch/byteorder.h b/arch/cris/include/arch-v10/arch/byteorder.h deleted file mode 100644 index 255b646b7fa8..000000000000 --- a/arch/cris/include/arch-v10/arch/byteorder.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef _CRIS_ARCH_BYTEORDER_H -#define _CRIS_ARCH_BYTEORDER_H - -#include -#include - -/* we just define these two (as we can do the swap in a single - * asm instruction in CRIS) and the arch-independent files will put - * them together into ntohl etc. - */ - -static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) -{ - __asm__ ("swapwb %0" : "=r" (x) : "0" (x)); - - return(x); -} - -static inline __attribute_const__ __u16 ___arch__swab16(__u16 x) -{ - __asm__ ("swapb %0" : "=r" (x) : "0" (x)); - - return(x); -} - -#endif diff --git a/arch/cris/include/arch-v10/arch/swab.h b/arch/cris/include/arch-v10/arch/swab.h new file mode 100644 index 000000000000..e4e847d8a05e --- /dev/null +++ b/arch/cris/include/arch-v10/arch/swab.h @@ -0,0 +1,30 @@ +#ifndef _CRIS_ARCH_SWAB_H +#define _CRIS_ARCH_SWAB_H + +#include +#include + +#define __SWAB_64_THRU_32__ + +/* we just define these two (as we can do the swap in a single + * asm instruction in CRIS) and the arch-independent files will put + * them together into ntohl etc. + */ + +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) +{ + __asm__ ("swapb %0" : "=r" (x) : "0" (x)); + + return(x); +} +#define __arch_swab16 __arch_swab16 + +#endif -- cgit v1.2.3