This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-sh64 / unaligned.h
1 #ifndef __ASM_SH64_UNALIGNED_H
2 #define __ASM_SH64_UNALIGNED_H
3
4 /*
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
7  * for more details.
8  *
9  * include/asm-sh64/unaligned.h
10  *
11  * Copyright (C) 2000, 2001  Paolo Alberelli
12  *
13  */
14
15 #include <linux/string.h>
16
17
18 /* Use memmove here, so gcc does not insert a __builtin_memcpy. */
19
20 #define get_unaligned(ptr) \
21   ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
22
23 #define put_unaligned(val, ptr)                         \
24   ({ __typeof__(*(ptr)) __tmp = (val);                  \
25      memmove((ptr), &__tmp, sizeof(*(ptr)));            \
26      (void)0; })
27
28 #endif /* __ASM_SH64_UNALIGNED_H */