RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / include / asm-avr32 / unaligned.h
blob3042723fcbfd69b267ba8e8216be5d7090cb771c
1 #ifndef __ASM_AVR32_UNALIGNED_H
2 #define __ASM_AVR32_UNALIGNED_H
4 /*
5 * AVR32 can handle some unaligned accesses, depending on the
6 * implementation. The AVR32 AP implementation can handle unaligned
7 * words, but halfwords must be halfword-aligned, and doublewords must
8 * be word-aligned.
10 * TODO: Make all this CPU-specific and optimize.
13 #include <linux/string.h>
15 /* Use memmove here, so gcc does not insert a __builtin_memcpy. */
17 #define get_unaligned(ptr) \
18 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
20 #define put_unaligned(val, ptr) \
21 ({ __typeof__(*(ptr)) __tmp = (val); \
22 memmove((ptr), &__tmp, sizeof(*(ptr))); \
23 (void)0; })
25 #endif /* __ASM_AVR32_UNALIGNED_H */