No functional changes, convert arches that use the packed-struct
implementation for native-endianness and C byteshifting for the
other endianness.
Signed-off-by: Harvey Harrison <[email protected]>
---
arch/alpha/include/asm/unaligned.h | 7 +------
arch/avr32/include/asm/unaligned.h | 8 +-------
arch/blackfin/include/asm/unaligned.h | 7 +------
arch/ia64/include/asm/unaligned.h | 7 +------
arch/mips/include/asm/unaligned.h | 17 +----------------
arch/parisc/include/asm/unaligned.h | 6 +-----
arch/sh/include/asm/unaligned.h | 15 +--------------
arch/sparc/include/asm/unaligned.h | 6 +-----
arch/xtensa/include/asm/unaligned.h | 16 +---------------
include/asm-frv/unaligned.h | 7 +------
10 files changed, 10 insertions(+), 86 deletions(-)
diff --git a/arch/alpha/include/asm/unaligned.h b/arch/alpha/include/asm/unaligned.h
index 3787c60..15d5fb6 100644
--- a/arch/alpha/include/asm/unaligned.h
+++ b/arch/alpha/include/asm/unaligned.h
@@ -1,11 +1,6 @@
#ifndef _ASM_ALPHA_UNALIGNED_H
#define _ASM_ALPHA_UNALIGNED_H
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#define get_unaligned __get_unaligned_le
-#define put_unaligned __put_unaligned_le
+#include <asm-generic/unaligned.h>
#endif /* _ASM_ALPHA_UNALIGNED_H */
diff --git a/arch/avr32/include/asm/unaligned.h b/arch/avr32/include/asm/unaligned.h
index 0418772..6352ba2 100644
--- a/arch/avr32/include/asm/unaligned.h
+++ b/arch/avr32/include/asm/unaligned.h
@@ -10,12 +10,6 @@
* However, swapped word loads must be word-aligned so we can't
* optimize word loads in general.
*/
-
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#define get_unaligned __get_unaligned_be
-#define put_unaligned __put_unaligned_be
+#include <asm-generic/unaligned.h>
#endif /* _ASM_AVR32_UNALIGNED_H */
diff --git a/arch/blackfin/include/asm/unaligned.h b/arch/blackfin/include/asm/unaligned.h
index fd8a1d6..ffed1bd 100644
--- a/arch/blackfin/include/asm/unaligned.h
+++ b/arch/blackfin/include/asm/unaligned.h
@@ -1,11 +1,6 @@
#ifndef _ASM_BLACKFIN_UNALIGNED_H
#define _ASM_BLACKFIN_UNALIGNED_H
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#define get_unaligned __get_unaligned_le
-#define put_unaligned __put_unaligned_le
+#include <asm-generic/unaligned.h>
#endif /* _ASM_BLACKFIN_UNALIGNED_H */
diff --git a/arch/ia64/include/asm/unaligned.h b/arch/ia64/include/asm/unaligned.h
index 7bddc7f..bb85598 100644
--- a/arch/ia64/include/asm/unaligned.h
+++ b/arch/ia64/include/asm/unaligned.h
@@ -1,11 +1,6 @@
#ifndef _ASM_IA64_UNALIGNED_H
#define _ASM_IA64_UNALIGNED_H
-#include <linux/unaligned/le_struct.h>
-#include <linux/unaligned/be_byteshift.h>
-#include <linux/unaligned/generic.h>
-
-#define get_unaligned __get_unaligned_le
-#define put_unaligned __put_unaligned_le
+#include <asm-generic/unaligned.h>
#endif /* _ASM_IA64_UNALIGNED_H */
diff --git a/arch/mips/include/asm/unaligned.h b/arch/mips/include/asm/unaligned.h
index 7924049..a970d81 100644
--- a/arch/mips/include/asm/unaligned.h
+++ b/arch/mips/include/asm/unaligned.h
@@ -8,21 +8,6 @@
#ifndef _ASM_MIPS_UNALIGNED_H
#define _ASM_MIPS_UNALIGNED_H
-#include <linux/compiler.h>
-#if defined(__MIPSEB__)
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_be
-# define put_unaligned __put_unaligned_be
-#elif defined(__MIPSEL__)
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_le
-# define put_unaligned __put_unaligned_le
-#else
-# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
-#endif
+#include <asm-generic/unaligned.h>
#endif /* _ASM_MIPS_UNALIGNED_H */
diff --git a/arch/parisc/include/asm/unaligned.h b/arch/parisc/include/asm/unaligned.h
index dfc5d33..7412f5f 100644
--- a/arch/parisc/include/asm/unaligned.h
+++ b/arch/parisc/include/asm/unaligned.h
@@ -1,11 +1,7 @@
#ifndef _ASM_PARISC_UNALIGNED_H
#define _ASM_PARISC_UNALIGNED_H
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-#define get_unaligned __get_unaligned_be
-#define put_unaligned __put_unaligned_be
+#include <asm-generic/unaligned.h>
#ifdef __KERNEL__
struct pt_regs;
diff --git a/arch/sh/include/asm/unaligned.h b/arch/sh/include/asm/unaligned.h
index c1641a0..abe2dd7 100644
--- a/arch/sh/include/asm/unaligned.h
+++ b/arch/sh/include/asm/unaligned.h
@@ -1,19 +1,6 @@
#ifndef _ASM_SH_UNALIGNED_H
#define _ASM_SH_UNALIGNED_H
-/* SH can't handle unaligned accesses. */
-#ifdef __LITTLE_ENDIAN__
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_le
-# define put_unaligned __put_unaligned_le
-#else
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_be
-# define put_unaligned __put_unaligned_be
-#endif
+#include <asm-generic/unaligned.h>
#endif /* _ASM_SH_UNALIGNED_H */
diff --git a/arch/sparc/include/asm/unaligned.h b/arch/sparc/include/asm/unaligned.h
index 11d2d5f..1a633da 100644
--- a/arch/sparc/include/asm/unaligned.h
+++ b/arch/sparc/include/asm/unaligned.h
@@ -1,10 +1,6 @@
#ifndef _ASM_SPARC_UNALIGNED_H
#define _ASM_SPARC_UNALIGNED_H
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/generic.h>
-#define get_unaligned __get_unaligned_be
-#define put_unaligned __put_unaligned_be
+#include <asm-generic/unaligned.h>
#endif /* _ASM_SPARC_UNALIGNED_H */
diff --git a/arch/xtensa/include/asm/unaligned.h b/arch/xtensa/include/asm/unaligned.h
index 8e7ed04..3922953 100644
--- a/arch/xtensa/include/asm/unaligned.h
+++ b/arch/xtensa/include/asm/unaligned.h
@@ -10,20 +10,6 @@
#ifndef _ASM_XTENSA_UNALIGNED_H
#define _ASM_XTENSA_UNALIGNED_H
-#include <asm/byteorder.h>
-
-#ifdef __LITTLE_ENDIAN
-# include <linux/unaligned/le_struct.h>
-# include <linux/unaligned/be_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_le
-# define put_unaligned __put_unaligned_le
-#else
-# include <linux/unaligned/be_struct.h>
-# include <linux/unaligned/le_byteshift.h>
-# include <linux/unaligned/generic.h>
-# define get_unaligned __get_unaligned_be
-# define put_unaligned __put_unaligned_be
-#endif
+#include <asm-generic/unaligned.h>
#endif /* _ASM_XTENSA_UNALIGNED_H */
diff --git a/include/asm-frv/unaligned.h b/include/asm-frv/unaligned.h
index 6c61c05..4fec13c 100644
--- a/include/asm-frv/unaligned.h
+++ b/include/asm-frv/unaligned.h
@@ -12,11 +12,6 @@
#ifndef _ASM_UNALIGNED_H
#define _ASM_UNALIGNED_H
-#include <linux/unaligned/le_byteshift.h>
-#include <linux/unaligned/be_struct.h>
-#include <linux/unaligned/generic.h>
-
-#define get_unaligned __get_unaligned_be
-#define put_unaligned __put_unaligned_be
+#include <asm-generic/unaligned.h>
#endif /* _ASM_UNALIGNED_H */
--
1.6.0.4.994.g16bd3e
On Mon, 17 Nov 2008 19:39:11 -0800
Harvey Harrison <[email protected]> wrote:
> No functional changes, convert arches that use the packed-struct
> implementation for native-endianness and C byteshifting for the
> other endianness.
arch/sh has gone and changed things in linux-next.
> diff --git a/arch/sh/include/asm/unaligned.h b/arch/sh/include/asm/unaligned.h
> index c1641a0..abe2dd7 100644
> --- a/arch/sh/include/asm/unaligned.h
> +++ b/arch/sh/include/asm/unaligned.h
> @@ -1,19 +1,6 @@
> #ifndef _ASM_SH_UNALIGNED_H
> #define _ASM_SH_UNALIGNED_H
>
> -/* SH can't handle unaligned accesses. */
> -#ifdef __LITTLE_ENDIAN__
> -# include <linux/unaligned/le_struct.h>
> -# include <linux/unaligned/be_byteshift.h>
> -# include <linux/unaligned/generic.h>
> -# define get_unaligned __get_unaligned_le
> -# define put_unaligned __put_unaligned_le
> -#else
> -# include <linux/unaligned/be_struct.h>
> -# include <linux/unaligned/le_byteshift.h>
> -# include <linux/unaligned/generic.h>
> -# define get_unaligned __get_unaligned_be
> -# define put_unaligned __put_unaligned_be
> -#endif
> +#include <asm-generic/unaligned.h>
>
> #endif /* _ASM_SH_UNALIGNED_H */
But this happened instead:
--- linux-2.6.28-rc6/arch/sh/include/asm/unaligned.h 2008-10-15 11:43:12.000000000 -0700
+++ 25/arch/sh/include/asm/unaligned.h 2008-11-26 12:32:18.000000000 -0800
@@ -1,7 +1,11 @@
#ifndef _ASM_SH_UNALIGNED_H
#define _ASM_SH_UNALIGNED_H
-/* SH can't handle unaligned accesses. */
+#ifdef CONFIG_CPU_SH4A
+/* SH-4A can handle unaligned loads in a relatively neutered fashion. */
+#include <asm/unaligned-sh4a.h>
+#else
+/* Otherwise, SH can't handle unaligned accesses. */
#ifdef __LITTLE_ENDIAN__
# include <linux/unaligned/le_struct.h>
# include <linux/unaligned/be_byteshift.h>
@@ -15,5 +19,6 @@
# define get_unaligned __get_unaligned_be
# define put_unaligned __put_unaligned_be
#endif
+#endif
#endif /* _ASM_SH_UNALIGNED_H */
It's a bit sad to create a new variant of the sh unaligned accessors
while Harvey is madly tugging everything in the opposite direction.
I am tempted to revise the patch by just blowing away the above
changes, so the new unaligned-sh4a.h just doesn't get used by anything.
However...
commit accccfb3d8c2cb65baf7cdfc74a2da4cdeee65ab
Author: Paul Mundt <[email protected]>
Date: Wed Nov 26 00:29:58 2008 +0900
sh: Provide optimized unaligned loads on SH-4A.
This adds support for unaligned loads on SH-4A, using the SH-4A's
neutered movua.l instruction. As movua.l is r0-inspired, stores are
still handled through the packed struct.
Based on asm-generic/unaligned.h by Harvey Harrison.
Signed-off-by: Paul Mundt <[email protected]>
so I'll just drop the sh hunk from
unaligned-use-generic-implementation-on-packed-struct-arches.patch, I
think.
On Wed, 2008-11-26 at 12:40 -0800, Andrew Morton wrote:
> On Mon, 17 Nov 2008 19:39:11 -0800
> Harvey Harrison <[email protected]> wrote:
>
> > No functional changes, convert arches that use the packed-struct
> > implementation for native-endianness and C byteshifting for the
> > other endianness.
>
> arch/sh has gone and changed things in linux-next.
Yes, please drop the SH portions of my patch in -mm (your inbox should
already have such a patch)
I also followed up with a new patch to deal with the SH changes and
then a revised patch to deal with some fallout in
asm-generic/unaligned.h
Hopefully this is agreable to everyone.
> so I'll just drop the sh hunk from
> unaligned-use-generic-implementation-on-packed-struct-arches.patch, I
> think.
>
Please do and add my revised patch and the sh-specific patch.
Cheers,
Harvey