URL
https://opencores.org/ocsvn/or1k_soc_on_altera_embedded_dev_kit/or1k_soc_on_altera_embedded_dev_kit/trunk
Subversion Repositories or1k_soc_on_altera_embedded_dev_kit
[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [linux-2.6/] [linux-2.6.24/] [include/] [asm-or32/] [unaligned.h] - Rev 19
Compare with Previous | Blame | View Log
#ifdef __KERNEL__ #ifndef _OR32_UNALIGNED_H #define _OR32_UNALIGNED_H /* #define get_unaligned(ptr) ({ \ typeof((*(ptr))) x; \ memcpy(&x, (void*)ptr, sizeof(*(ptr))); \ x; \ }) #define put_unaligned(val, ptr) ({ \ typeof((*(ptr))) x = val; \ memcpy((void*)ptr, &x, sizeof(*(ptr))); \ }) */ #define get_unaligned(ptr) \ ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) #define put_unaligned(val, ptr) \ ({ __typeof__(*(ptr)) __tmp = (val); \ memmove((ptr), &__tmp, sizeof(*(ptr))); \ (void)0; }) #endif #endif /* __KERNEL__ */