OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-or32/] [unaligned.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1276 phoenix
#ifdef __KERNEL__
2
#ifndef _OR32_UNALIGNED_H
3
#define _OR32_UNALIGNED_H
4
 
5
#define get_unaligned(ptr) ({                   \
6
        typeof((*(ptr))) x;                     \
7
        memcpy(&x, (void*)ptr, sizeof(*(ptr))); \
8
        x;                                      \
9
})
10
 
11
#define put_unaligned(val, ptr) ({              \
12
        typeof((*(ptr))) x = val;               \
13
        memcpy((void*)ptr, &x, sizeof(*(ptr))); \
14
})
15
 
16
#endif
17
#endif /* __KERNEL__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.