diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-03-16 17:54:49 +1000 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2009-03-16 17:54:49 +1000 |
commit | 9863a0babc2f0d920dfb4ddecf4e5b5342cb986b (patch) | |
tree | 59f9efa0e9c118ce659e5bda70aac50fa6c5d7ac /arch/m68k/include/asm/swab.h | |
parent | f9847004bf94ba5457738cb5e0f868821864ff50 (diff) |
m68k: merge the non-MMU and MMU versions of swab.h
It is trivial to merge the non-MMU and MMU versions of swab.h.
Without a single file "make headers_install" is broken for m68k
(since each of the sub-varients of swab.h are not installed).
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68k/include/asm/swab.h')
-rw-r--r-- | arch/m68k/include/asm/swab.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/arch/m68k/include/asm/swab.h b/arch/m68k/include/asm/swab.h index 7d7dde1c73e..9e3054ea59e 100644 --- a/arch/m68k/include/asm/swab.h +++ b/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 <asm/types.h> +#include <linux/compiler.h> + +#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 */ |