diff options
| author | Ingo Molnar <[email protected]> | 2009-03-23 16:53:20 +0100 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2009-03-23 16:53:20 +0100 |
| commit | efd247fa34084d9b162f485004ae6d8a04059f0c (patch) | |
| tree | 417dcbe06d5cce1353a4c19cbda480ae67652b5c /arch/m68k/include/asm/swab.h | |
| parent | af66df5ecf9c9e2d2ff86e8203510c1c4519d64c (diff) | |
| parent | 59fcbddaff6f862cc1584b488866d9c4a5579085 (diff) | |
Merge branches 'sched/debug' and 'linus' into sched/core
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 */ |