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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-or32/] [unaligned.h] - Blame information for rev 1777

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

Line No. Rev Author Line
1 1633 jcastillo
#ifndef __OR32_UNALIGNED_H
2
#define __OR32_UNALIGNED_H
3
 
4
#define get_unaligned(ptr) ({                   \
5
        typeof((*(ptr))) x;                     \
6
        memcpy(&x, (void*)ptr, sizeof(*(ptr))); \
7
        x;                                      \
8
})
9
 
10
#define put_unaligned(val, ptr) ({              \
11
        typeof((*(ptr))) x = val;               \
12
        memcpy((void*)ptr, &x, sizeof(*(ptr))); \
13
})
14
 
15
#endif

powered by: WebSVN 2.1.0

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