diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-03-16 03:54:49 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2009-03-16 03:54:49 -0400 |
commit | 9863a0babc2f0d920dfb4ddecf4e5b5342cb986b (patch) | |
tree | 59f9efa0e9c118ce659e5bda70aac50fa6c5d7ac /arch | |
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')
-rw-r--r-- | arch/m68k/include/asm/swab.h | 30 | ||||
-rw-r--r-- | arch/m68k/include/asm/swab_mm.h | 16 | ||||
-rw-r--r-- | arch/m68k/include/asm/swab_no.h | 24 |
3 files changed, 26 insertions, 44 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 @@ | |||
1 | #ifdef __uClinux__ | 1 | #ifndef _M68K_SWAB_H |
2 | #include "swab_no.h" | 2 | #define _M68K_SWAB_H |
3 | #else | 3 | |
4 | #include "swab_mm.h" | 4 | #include <asm/types.h> |
5 | #include <linux/compiler.h> | ||
6 | |||
7 | #define __SWAB_64_THRU_32__ | ||
8 | |||
9 | #if defined (__mcfisaaplus__) || defined (__mcfisac__) | ||
10 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
11 | { | ||
12 | __asm__("byterev %0" : "=d" (val) : "0" (val)); | ||
13 | return val; | ||
14 | } | ||
15 | |||
16 | #define __arch_swab32 __arch_swab32 | ||
17 | #elif !defined(__uClinux__) | ||
18 | |||
19 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
20 | { | ||
21 | __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); | ||
22 | return val; | ||
23 | } | ||
24 | #define __arch_swab32 __arch_swab32 | ||
5 | #endif | 25 | #endif |
26 | |||
27 | #endif /* _M68K_SWAB_H */ | ||
diff --git a/arch/m68k/include/asm/swab_mm.h b/arch/m68k/include/asm/swab_mm.h deleted file mode 100644 index 7221e3066825..000000000000 --- a/arch/m68k/include/asm/swab_mm.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef _M68K_SWAB_H | ||
2 | #define _M68K_SWAB_H | ||
3 | |||
4 | #include <asm/types.h> | ||
5 | #include <linux/compiler.h> | ||
6 | |||
7 | #define __SWAB_64_THRU_32__ | ||
8 | |||
9 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
10 | { | ||
11 | __asm__("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); | ||
12 | return val; | ||
13 | } | ||
14 | #define __arch_swab32 __arch_swab32 | ||
15 | |||
16 | #endif /* _M68K_SWAB_H */ | ||
diff --git a/arch/m68k/include/asm/swab_no.h b/arch/m68k/include/asm/swab_no.h deleted file mode 100644 index e582257db300..000000000000 --- a/arch/m68k/include/asm/swab_no.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | #ifndef _M68KNOMMU_SWAB_H | ||
2 | #define _M68KNOMMU_SWAB_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) | ||
7 | # define __SWAB_64_THRU_32__ | ||
8 | #endif | ||
9 | |||
10 | #if defined (__mcfisaaplus__) || defined (__mcfisac__) | ||
11 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | ||
12 | { | ||
13 | asm( | ||
14 | "byterev %0" | ||
15 | : "=d" (val) | ||
16 | : "0" (val) | ||
17 | ); | ||
18 | return val; | ||
19 | } | ||
20 | |||
21 | #define __arch_swab32 __arch_swab32 | ||
22 | #endif | ||
23 | |||
24 | #endif /* _M68KNOMMU_SWAB_H */ | ||