From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@linux-foundation.org Subject: + unaligned-wire-up-h8300-and-m32r-arches.patch added to -mm tree Date: Tue, 02 Dec 2008 14:57:37 -0800 Message-ID: <200812022257.mB2MvbDD022248@imap1.linux-foundation.org> Reply-To: linux-kernel@vger.kernel.org Return-path: Sender: mm-commits-owner@vger.kernel.org To: mm-commits@vger.kernel.org Cc: harvey.harrison@gmail.com, linux-arch@vger.kernel.org, takata@linux-m32r.org, ysato@users.sourceforge.jp List-Id: linux-arch.vger.kernel.org The patch titled unaligned: wire up h8300 and m32r arches has been added to the -mm tree. Its filename is unaligned-wire-up-h8300-and-m32r-arches.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: unaligned: wire up h8300 and m32r arches From: Harvey Harrison Provide arch overrides using memmove to avoid any functional changes. At a later time these arches should be able to just use the common header directly, but this is not certain currently. Signed-off-by: Harvey Harrison Cc: Cc: Yoshinori Sato Cc: Hirokazu Takata Signed-off-by: Andrew Morton --- arch/h8300/include/asm/unaligned.h | 51 ++++++++++++++++++++-- include/asm-m32r/unaligned.h | 60 +++++++++++++++++++++------ 2 files changed, 93 insertions(+), 18 deletions(-) diff -puN arch/h8300/include/asm/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches arch/h8300/include/asm/unaligned.h --- a/arch/h8300/include/asm/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches +++ a/arch/h8300/include/asm/unaligned.h @@ -1,11 +1,52 @@ #ifndef _ASM_H8300_UNALIGNED_H #define _ASM_H8300_UNALIGNED_H -#include -#include -#include +#include +#include -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be +/* Use memmove here, so gcc does not insert a __builtin_memcpy. */ +static inline u16 __arch_load_cpu16_noalign(const void *p) +{ + u16 tmp; + memmove(&tmp, p, 2); + return tmp; +} +#define __arch_load_cpu16_noalign __arch_load_cpu16_noalign + +static inline u32 __arch_load_cpu32_noalign(const void *p) +{ + u32 tmp; + memmove(&tmp, p, 4); + return tmp; +} +#define __arch_load_cpu32_noalign __arch_load_cpu32_noalign + +static inline u64 __arch_load_cpu16_noalign(const void *p) +{ + u64 tmp; + memmove(&tmp, p, 8); + return tmp; +} +#define __arch_load_cpu64_noalign __arch_load_cpu64_noalign + +static inline void __arch_store_cpu16_noalign(void *p, u16 val) +{ + memmove(p, &val, 2); +} +#define __arch_store_cpu16_noalign __arch_store_cpu16_noalign + +static inline void __arch_store_cpu32_noalign(void *p, u32 val) +{ + memmove(p, &val, 4); +} +#define __arch_store_cpu32_noalign __arch_store_cpu32_noalign + +static inline void __arch_store_cpu64_noalign(void *p, u64 val) +{ + memmove(p, &val, 8); +} +#define __arch_store_cpu64_noalign __arch_store_cpu64_noalign + +#include #endif /* _ASM_H8300_UNALIGNED_H */ diff -puN include/asm-m32r/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches include/asm-m32r/unaligned.h --- a/include/asm-m32r/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches +++ a/include/asm-m32r/unaligned.h @@ -1,18 +1,52 @@ #ifndef _ASM_M32R_UNALIGNED_H #define _ASM_M32R_UNALIGNED_H -#if defined(__LITTLE_ENDIAN__) -# include -# include -# include -# define get_unaligned __get_unaligned_le -# define put_unaligned __put_unaligned_le -#else -# include -# include -# include -# define get_unaligned __get_unaligned_be -# define put_unaligned __put_unaligned_be -#endif +#include +#include +/* Use memmove here, so gcc does not insert a __builtin_memcpy. */ + +static inline u16 __arch_load_cpu16_noalign(const void *p) +{ + u16 tmp; + memmove(&tmp, p, 2); + return tmp; +} +#define __arch_load_cpu16_noalign __arch_load_cpu16_noalign + +static inline u32 __arch_load_cpu32_noalign(const void *p) +{ + u32 tmp; + memmove(&tmp, p, 4); + return tmp; +} +#define __arch_load_cpu32_noalign __arch_load_cpu32_noalign + +static inline u64 __arch_load_cpu16_noalign(const void *p) +{ + u64 tmp; + memmove(&tmp, p, 8); + return tmp; +} +#define __arch_load_cpu64_noalign __arch_load_cpu64_noalign + +static inline void __arch_store_cpu16_noalign(void *p, u16 val) +{ + memmove(p, &val, 2); +} +#define __arch_store_cpu16_noalign __arch_store_cpu16_noalign + +static inline void __arch_store_cpu32_noalign(void *p, u32 val) +{ + memmove(p, &val, 4); +} +#define __arch_store_cpu32_noalign __arch_store_cpu32_noalign + +static inline void __arch_store_cpu64_noalign(void *p, u64 val) +{ + memmove(p, &val, 8); +} +#define __arch_store_cpu64_noalign __arch_store_cpu64_noalign + +#include #endif /* _ASM_M32R_UNALIGNED_H */ _ Patches currently in -mm which might be from harvey.harrison@gmail.com are linux-next.patch arm-use-the-new-byteorder-headers.patch i2c-misannotation-in-i2c-pmcmspc.patch i2c-trivial-endian-casting-fixes-in-i2c-highlanderc.patch ia64-use-the-new-byteorder-headers.patch m32r-use-the-new-byteorder-headers.patch blackfin-remove-__function__-in-new-serial-driver.patch blackfin-use-the-new-byteorder-headers.patch parisc-use-the-new-byteorder-headers.patch s390-use-the-new-byteorder-headers.patch scsi-replace-__inline-with-inline.patch scsi-use-the-common-hex_asc-array-rather-than-a-private-one.patch scsi-gdthc-use-unaligned-access-helpers.patch scsi-annotate-gdth_rdcap_data-gdth_rdcap16_data-endianness.patch frv-use-the-new-byteorder-headers.patch m68knommu-use-the-new-byteorder-headers.patch h8300-use-the-new-byteorder-headers.patch alpha-use-the-new-byteorder-headers.patch lib-fix-sparse-shadowed-variable-warning.patch lib-radix_treec-make-percpu-variable-static.patch lib-proportionsc-trivial-sparse-lock-annotation.patch ibmpex-add-endian-annotation-to-extract_data-helper.patch blackfin-remove-__function__-in-video-driver.patch fb-carminefb-trivial-annotation-packing-color-register.patch memstick-annotate-endianness-of-attribute-structs.patch byteorder-add-load_-store_endian-api.patch unaligned-consolidate-unaligned-headers-add-load_-store_endian_noalign.patch unaligned-wire-up-trivial-arches-for-new-common-unaligned-header.patch sh-wire-up-arch-overrides-for-unaligned-access-on-the-sh4a.patch unaligned-wire-up-h8300-and-m32r-arches.patch unaligned-wire-up-arm-arch-overrides-for-unaligned-access.patch unaligned-remove-the-old-implementation.patch From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:57452 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752703AbYLBW6A (ORCPT ); Tue, 2 Dec 2008 17:58:00 -0500 Message-ID: <200812022257.mB2MvbDD022248@imap1.linux-foundation.org> Subject: + unaligned-wire-up-h8300-and-m32r-arches.patch added to -mm tree From: akpm@linux-foundation.org Date: Tue, 02 Dec 2008 14:57:37 -0800 Sender: linux-arch-owner@vger.kernel.org List-ID: To: mm-commits@vger.kernel.org Cc: harvey.harrison@gmail.com, linux-arch@vger.kernel.org, takata@linux-m32r.org, ysato@users.sourceforge.jp Message-ID: <20081202225737.aEmsyHn5-FHnYau5hASSXnkaTnbtHCmDcrXTP0iLGLA@z> The patch titled unaligned: wire up h8300 and m32r arches has been added to the -mm tree. Its filename is unaligned-wire-up-h8300-and-m32r-arches.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: unaligned: wire up h8300 and m32r arches From: Harvey Harrison Provide arch overrides using memmove to avoid any functional changes. At a later time these arches should be able to just use the common header directly, but this is not certain currently. Signed-off-by: Harvey Harrison Cc: Cc: Yoshinori Sato Cc: Hirokazu Takata Signed-off-by: Andrew Morton --- arch/h8300/include/asm/unaligned.h | 51 ++++++++++++++++++++-- include/asm-m32r/unaligned.h | 60 +++++++++++++++++++++------ 2 files changed, 93 insertions(+), 18 deletions(-) diff -puN arch/h8300/include/asm/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches arch/h8300/include/asm/unaligned.h --- a/arch/h8300/include/asm/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches +++ a/arch/h8300/include/asm/unaligned.h @@ -1,11 +1,52 @@ #ifndef _ASM_H8300_UNALIGNED_H #define _ASM_H8300_UNALIGNED_H -#include -#include -#include +#include +#include -#define get_unaligned __get_unaligned_be -#define put_unaligned __put_unaligned_be +/* Use memmove here, so gcc does not insert a __builtin_memcpy. */ +static inline u16 __arch_load_cpu16_noalign(const void *p) +{ + u16 tmp; + memmove(&tmp, p, 2); + return tmp; +} +#define __arch_load_cpu16_noalign __arch_load_cpu16_noalign + +static inline u32 __arch_load_cpu32_noalign(const void *p) +{ + u32 tmp; + memmove(&tmp, p, 4); + return tmp; +} +#define __arch_load_cpu32_noalign __arch_load_cpu32_noalign + +static inline u64 __arch_load_cpu16_noalign(const void *p) +{ + u64 tmp; + memmove(&tmp, p, 8); + return tmp; +} +#define __arch_load_cpu64_noalign __arch_load_cpu64_noalign + +static inline void __arch_store_cpu16_noalign(void *p, u16 val) +{ + memmove(p, &val, 2); +} +#define __arch_store_cpu16_noalign __arch_store_cpu16_noalign + +static inline void __arch_store_cpu32_noalign(void *p, u32 val) +{ + memmove(p, &val, 4); +} +#define __arch_store_cpu32_noalign __arch_store_cpu32_noalign + +static inline void __arch_store_cpu64_noalign(void *p, u64 val) +{ + memmove(p, &val, 8); +} +#define __arch_store_cpu64_noalign __arch_store_cpu64_noalign + +#include #endif /* _ASM_H8300_UNALIGNED_H */ diff -puN include/asm-m32r/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches include/asm-m32r/unaligned.h --- a/include/asm-m32r/unaligned.h~unaligned-wire-up-h8300-and-m32r-arches +++ a/include/asm-m32r/unaligned.h @@ -1,18 +1,52 @@ #ifndef _ASM_M32R_UNALIGNED_H #define _ASM_M32R_UNALIGNED_H -#if defined(__LITTLE_ENDIAN__) -# include -# include -# include -# define get_unaligned __get_unaligned_le -# define put_unaligned __put_unaligned_le -#else -# include -# include -# include -# define get_unaligned __get_unaligned_be -# define put_unaligned __put_unaligned_be -#endif +#include +#include +/* Use memmove here, so gcc does not insert a __builtin_memcpy. */ + +static inline u16 __arch_load_cpu16_noalign(const void *p) +{ + u16 tmp; + memmove(&tmp, p, 2); + return tmp; +} +#define __arch_load_cpu16_noalign __arch_load_cpu16_noalign + +static inline u32 __arch_load_cpu32_noalign(const void *p) +{ + u32 tmp; + memmove(&tmp, p, 4); + return tmp; +} +#define __arch_load_cpu32_noalign __arch_load_cpu32_noalign + +static inline u64 __arch_load_cpu16_noalign(const void *p) +{ + u64 tmp; + memmove(&tmp, p, 8); + return tmp; +} +#define __arch_load_cpu64_noalign __arch_load_cpu64_noalign + +static inline void __arch_store_cpu16_noalign(void *p, u16 val) +{ + memmove(p, &val, 2); +} +#define __arch_store_cpu16_noalign __arch_store_cpu16_noalign + +static inline void __arch_store_cpu32_noalign(void *p, u32 val) +{ + memmove(p, &val, 4); +} +#define __arch_store_cpu32_noalign __arch_store_cpu32_noalign + +static inline void __arch_store_cpu64_noalign(void *p, u64 val) +{ + memmove(p, &val, 8); +} +#define __arch_store_cpu64_noalign __arch_store_cpu64_noalign + +#include #endif /* _ASM_M32R_UNALIGNED_H */ _ Patches currently in -mm which might be from harvey.harrison@gmail.com are linux-next.patch arm-use-the-new-byteorder-headers.patch i2c-misannotation-in-i2c-pmcmspc.patch i2c-trivial-endian-casting-fixes-in-i2c-highlanderc.patch ia64-use-the-new-byteorder-headers.patch m32r-use-the-new-byteorder-headers.patch blackfin-remove-__function__-in-new-serial-driver.patch blackfin-use-the-new-byteorder-headers.patch parisc-use-the-new-byteorder-headers.patch s390-use-the-new-byteorder-headers.patch scsi-replace-__inline-with-inline.patch scsi-use-the-common-hex_asc-array-rather-than-a-private-one.patch scsi-gdthc-use-unaligned-access-helpers.patch scsi-annotate-gdth_rdcap_data-gdth_rdcap16_data-endianness.patch frv-use-the-new-byteorder-headers.patch m68knommu-use-the-new-byteorder-headers.patch h8300-use-the-new-byteorder-headers.patch alpha-use-the-new-byteorder-headers.patch lib-fix-sparse-shadowed-variable-warning.patch lib-radix_treec-make-percpu-variable-static.patch lib-proportionsc-trivial-sparse-lock-annotation.patch ibmpex-add-endian-annotation-to-extract_data-helper.patch blackfin-remove-__function__-in-video-driver.patch fb-carminefb-trivial-annotation-packing-color-register.patch memstick-annotate-endianness-of-attribute-structs.patch byteorder-add-load_-store_endian-api.patch unaligned-consolidate-unaligned-headers-add-load_-store_endian_noalign.patch unaligned-wire-up-trivial-arches-for-new-common-unaligned-header.patch sh-wire-up-arch-overrides-for-unaligned-access-on-the-sh4a.patch unaligned-wire-up-h8300-and-m32r-arches.patch unaligned-wire-up-arm-arch-overrides-for-unaligned-access.patch unaligned-remove-the-old-implementation.patch