From 89cd6e33a9d026903bd21bd371bfc035ad0968c3 Mon Sep 17 00:00:00 2001 From: Greg Ungerer Date: Mon, 16 Mar 2009 17:54:49 +1000 Subject: [PATCH] --- yaml --- r: 132504 b: refs/heads/master c: 9863a0babc2f0d920dfb4ddecf4e5b5342cb986b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/m68k/include/asm/swab.h | 30 +++++++++++++++++++++++---- trunk/arch/m68k/include/asm/swab_mm.h | 16 -------------- trunk/arch/m68k/include/asm/swab_no.h | 24 --------------------- 4 files changed, 27 insertions(+), 45 deletions(-) delete mode 100644 trunk/arch/m68k/include/asm/swab_mm.h delete mode 100644 trunk/arch/m68k/include/asm/swab_no.h diff --git a/[refs] b/[refs] index 01cb667c29c4..93c76a7d2a5e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f9847004bf94ba5457738cb5e0f868821864ff50 +refs/heads/master: 9863a0babc2f0d920dfb4ddecf4e5b5342cb986b diff --git a/trunk/arch/m68k/include/asm/swab.h b/trunk/arch/m68k/include/asm/swab.h index 7d7dde1c73ec..9e3054ea59e9 100644 --- a/trunk/arch/m68k/include/asm/swab.h +++ b/trunk/arch/m68k/include/asm/swab.h @@ -1,5 +1,27 @@ -#ifdef __uClinux__ -#include "swab_no.h" -#else -#include "swab_mm.h" +#ifndef _M68K_SWAB_H +#define _M68K_SWAB_H + +#include +#include + +#define __SWAB_64_THRU_32__ + +#if defined (__mcfisaaplus__) || defined (__mcfisac__) +static inline __attribute_const__ __u32 __arch_swab32(__u32 val) +{ + __asm__("byterev %0" : "=d" (val) : "0" (val)); + return val; +} + +#define __arch_swab32 __arch_swab32 +#elif !defined(__uClinux__) + +static inline __attribute_const__ __u32 __arch_swab32(__u32 val) +{ + __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); + return val; +} +#define __arch_swab32 __arch_swab32 #endif + +#endif /* _M68K_SWAB_H */ diff --git a/trunk/arch/m68k/include/asm/swab_mm.h b/trunk/arch/m68k/include/asm/swab_mm.h deleted file mode 100644 index 7221e3066825..000000000000 --- a/trunk/arch/m68k/include/asm/swab_mm.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _M68K_SWAB_H -#define _M68K_SWAB_H - -#include -#include - -#define __SWAB_64_THRU_32__ - -static inline __attribute_const__ __u32 __arch_swab32(__u32 val) -{ - __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); - return val; -} -#define __arch_swab32 __arch_swab32 - -#endif /* _M68K_SWAB_H */ diff --git a/trunk/arch/m68k/include/asm/swab_no.h b/trunk/arch/m68k/include/asm/swab_no.h deleted file mode 100644 index e582257db300..000000000000 --- a/trunk/arch/m68k/include/asm/swab_no.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _M68KNOMMU_SWAB_H -#define _M68KNOMMU_SWAB_H - -#include - -#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) -# define __SWAB_64_THRU_32__ -#endif - -#if defined (__mcfisaaplus__) || defined (__mcfisac__) -static inline __attribute_const__ __u32 __arch_swab32(__u32 val) -{ - asm( - "byterev %0" - : "=d" (val) - : "0" (val) - ); - return val; -} - -#define __arch_swab32 __arch_swab32 -#endif - -#endif /* _M68KNOMMU_SWAB_H */