1 #ifndef __ASM_SH64_UNALIGNED_H
2 #define __ASM_SH64_UNALIGNED_H
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
9 * include/asm-sh64/unaligned.h
11 * Copyright (C) 2000, 2001 Paolo Alberelli
13 * SH can't handle unaligned accesses.
17 #include <linux/string.h>
20 /* Use memmove here, so gcc does not insert a __builtin_memcpy. */
22 #define get_unaligned(ptr) \
23 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
25 #define put_unaligned(val, ptr) \
26 ({ __typeof__(*(ptr)) __tmp = (val); \
27 memmove((ptr), &__tmp, sizeof(*(ptr))); \
30 #endif /* __ASM_SH64_UNALIGNED_H */