initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / asm-m68knommu / unaligned.h
blob2b047b0daf6844cbfb62b8a6ac89e16a6db0a615
1 #ifndef __M68K_UNALIGNED_H
2 #define __M68K_UNALIGNED_H
4 #include <linux/config.h>
6 #ifdef CONFIG_COLDFIRE
8 /* Use memmove here, so gcc does not insert a __builtin_memcpy. */
10 #define get_unaligned(ptr) \
11 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
13 #define put_unaligned(val, ptr) \
14 ({ __typeof__(*(ptr)) __tmp = (val); \
15 memmove((ptr), &__tmp, sizeof(*(ptr))); \
16 (void)0; })
18 #else
20 * The m68k can do unaligned accesses itself.
22 * The strange macros are there to make sure these can't
23 * be misused in a way that makes them not work on other
24 * architectures where unaligned accesses aren't as simple.
27 #define get_unaligned(ptr) (*(ptr))
28 #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
30 #endif
32 #endif