* [PATCH 3/8] kernel: move arches that use the no-builtin-memcpy implementation
@ 2008-04-10 19:44 Harvey Harrison
2008-04-10 19:44 ` Harvey Harrison
0 siblings, 1 reply; 2+ messages in thread
From: Harvey Harrison @ 2008-04-10 19:44 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-arch, Yoshinori Sato, Hirokazu Takata, Chris Zankel
h8300, m32r, xtensa use this implementation.
Signed-off-by: Harvey Harrison <harvey.harrison-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
include/asm-h8300/unaligned.h | 11 +----------
include/asm-m32r/unaligned.h | 15 +--------------
include/asm-xtensa/unaligned.h | 12 +-----------
3 files changed, 3 insertions(+), 35 deletions(-)
diff --git a/include/asm-h8300/unaligned.h b/include/asm-h8300/unaligned.h
index ffb67f4..e8ff49d 100644
--- a/include/asm-h8300/unaligned.h
+++ b/include/asm-h8300/unaligned.h
@@ -1,15 +1,6 @@
#ifndef __H8300_UNALIGNED_H
#define __H8300_UNALIGNED_H
-
-/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
-
-#define get_unaligned(ptr) \
- ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
-
-#define put_unaligned(val, ptr) \
- ({ __typeof__(*(ptr)) __tmp = (val); \
- memmove((ptr), &__tmp, sizeof(*(ptr))); \
- (void)0; })
+#include <linux/unaligned/no_builtin_memcpy.h>
#endif
diff --git a/include/asm-m32r/unaligned.h b/include/asm-m32r/unaligned.h
index fccc180..5a4c931 100644
--- a/include/asm-m32r/unaligned.h
+++ b/include/asm-m32r/unaligned.h
@@ -1,19 +1,6 @@
#ifndef _ASM_M32R_UNALIGNED_H
#define _ASM_M32R_UNALIGNED_H
-/*
- * For the benefit of those who are trying to port Linux to another
- * architecture, here are some C-language equivalents.
- */
-
-#include <asm/string.h>
-
-#define get_unaligned(ptr) \
- ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
-
-#define put_unaligned(val, ptr) \
- ({ __typeof__(*(ptr)) __tmp = (val); \
- memmove((ptr), &__tmp, sizeof(*(ptr))); \
- (void)0; })
+#include <linux/unaligned/no_builtin_memcpy.h>
#endif /* _ASM_M32R_UNALIGNED_H */
diff --git a/include/asm-xtensa/unaligned.h b/include/asm-xtensa/unaligned.h
index 2822089..45eb203 100644
--- a/include/asm-xtensa/unaligned.h
+++ b/include/asm-xtensa/unaligned.h
@@ -13,16 +13,6 @@
#ifndef _XTENSA_UNALIGNED_H
#define _XTENSA_UNALIGNED_H
-#include <linux/string.h>
-
-/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
-
-#define get_unaligned(ptr) \
- ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
-
-#define put_unaligned(val, ptr) \
- ({ __typeof__(*(ptr)) __tmp = (val); \
- memmove((ptr), &__tmp, sizeof(*(ptr))); \
- (void)0; })
+#include <linux/unaligned/no_builtin_memcpy.h>
#endif /* _XTENSA_UNALIGNED_H */
--
1.5.5.144.g3e42
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 3/8] kernel: move arches that use the no-builtin-memcpy implementation
2008-04-10 19:44 [PATCH 3/8] kernel: move arches that use the no-builtin-memcpy implementation Harvey Harrison
@ 2008-04-10 19:44 ` Harvey Harrison
0 siblings, 0 replies; 2+ messages in thread
From: Harvey Harrison @ 2008-04-10 19:44 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-arch, Yoshinori Sato, Hirokazu Takata, Chris Zankel
h8300, m32r, xtensa use this implementation.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
include/asm-h8300/unaligned.h | 11 +----------
include/asm-m32r/unaligned.h | 15 +--------------
include/asm-xtensa/unaligned.h | 12 +-----------
3 files changed, 3 insertions(+), 35 deletions(-)
diff --git a/include/asm-h8300/unaligned.h b/include/asm-h8300/unaligned.h
index ffb67f4..e8ff49d 100644
--- a/include/asm-h8300/unaligned.h
+++ b/include/asm-h8300/unaligned.h
@@ -1,15 +1,6 @@
#ifndef __H8300_UNALIGNED_H
#define __H8300_UNALIGNED_H
-
-/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
-
-#define get_unaligned(ptr) \
- ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
-
-#define put_unaligned(val, ptr) \
- ({ __typeof__(*(ptr)) __tmp = (val); \
- memmove((ptr), &__tmp, sizeof(*(ptr))); \
- (void)0; })
+#include <linux/unaligned/no_builtin_memcpy.h>
#endif
diff --git a/include/asm-m32r/unaligned.h b/include/asm-m32r/unaligned.h
index fccc180..5a4c931 100644
--- a/include/asm-m32r/unaligned.h
+++ b/include/asm-m32r/unaligned.h
@@ -1,19 +1,6 @@
#ifndef _ASM_M32R_UNALIGNED_H
#define _ASM_M32R_UNALIGNED_H
-/*
- * For the benefit of those who are trying to port Linux to another
- * architecture, here are some C-language equivalents.
- */
-
-#include <asm/string.h>
-
-#define get_unaligned(ptr) \
- ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
-
-#define put_unaligned(val, ptr) \
- ({ __typeof__(*(ptr)) __tmp = (val); \
- memmove((ptr), &__tmp, sizeof(*(ptr))); \
- (void)0; })
+#include <linux/unaligned/no_builtin_memcpy.h>
#endif /* _ASM_M32R_UNALIGNED_H */
diff --git a/include/asm-xtensa/unaligned.h b/include/asm-xtensa/unaligned.h
index 2822089..45eb203 100644
--- a/include/asm-xtensa/unaligned.h
+++ b/include/asm-xtensa/unaligned.h
@@ -13,16 +13,6 @@
#ifndef _XTENSA_UNALIGNED_H
#define _XTENSA_UNALIGNED_H
-#include <linux/string.h>
-
-/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
-
-#define get_unaligned(ptr) \
- ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
-
-#define put_unaligned(val, ptr) \
- ({ __typeof__(*(ptr)) __tmp = (val); \
- memmove((ptr), &__tmp, sizeof(*(ptr))); \
- (void)0; })
+#include <linux/unaligned/no_builtin_memcpy.h>
#endif /* _XTENSA_UNALIGNED_H */
--
1.5.5.144.g3e42
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-10 19:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-10 19:44 [PATCH 3/8] kernel: move arches that use the no-builtin-memcpy implementation Harvey Harrison
2008-04-10 19:44 ` Harvey Harrison
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox