diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-24 03:38:30 +0100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-24 03:38:30 +0100 |
commit | 9e41d9597e7825ec20d690013d32bcec5f3fe16a (patch) | |
tree | ac6fea59e9a4a1c2183d6bbd6ffa760680673afb /arch/m68k/include/asm/swab.h | |
parent | Merge commit 'gcl/next' into next (diff) | |
parent | Linux 2.6.29 (diff) | |
download | linux-9e41d9597e7825ec20d690013d32bcec5f3fe16a.tar.xz linux-9e41d9597e7825ec20d690013d32bcec5f3fe16a.zip |
Merge commit 'origin/master' into next
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 7d7dde1c73ec..9e3054ea59e9 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 */ |