kernel: move arches that use the no-builtin-memcpy implementation
PATCH 3/8 kernel: move arches that use the no-builtin-memcpy implementation
h8300, m32r, xtensa use this implementation.
Signed-off-by Harvey Harrison <[email protected]>
--- 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(-)
include/asm-h8300/unaligned.h +1 -10
@@ -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
include/asm-m32r/unaligned.h +1 -14
@@ -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 */
include/asm-xtensa/unaligned.h +1 -11
@@ -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 */
Signature · 1 line
1.5.5.144.g3e42