Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / include / asm-mips / unaligned.h
blob3249049e93aafcc8eeb345b07a6d220f29a7398e
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
7 */
8 #ifndef __ASM_GENERIC_UNALIGNED_H
9 #define __ASM_GENERIC_UNALIGNED_H
11 #include <linux/compiler.h>
13 #define get_unaligned(ptr) \
14 ({ \
15 struct __packed { \
16 typeof(*(ptr)) __v; \
17 } *__p = (void *) (ptr); \
18 __p->__v; \
21 #define put_unaligned(val, ptr) \
22 do { \
23 struct __packed { \
24 typeof(*(ptr)) __v; \
25 } *__p = (void *) (ptr); \
26 __p->__v = (val); \
27 } while(0)
29 #endif /* __ASM_GENERIC_UNALIGNED_H */