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

Subversion Repositories or1k

[/] [or1k/] [tags/] [LINUX_2_4_26_OR32/] [linux/] [linux-2.4/] [include/] [asm-generic/] [unaligned.h] - Blame information for rev 1780

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

Line No. Rev Author Line
1 1276 phoenix
#ifndef _ASM_GENERIC_UNALIGNED_H_
2
#define _ASM_GENERIC_UNALIGNED_H_
3
 
4
/*
5
 * For the benefit of those who are trying to port Linux to another
6
 * architecture, here are some C-language equivalents.
7
 */
8
 
9
#include <asm/string.h>
10
 
11
 
12
#define get_unaligned(ptr) \
13
  ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
14
 
15
#define put_unaligned(val, ptr)                         \
16
  ({ __typeof__(*(ptr)) __tmp = (val);                  \
17
     memcpy((ptr), &__tmp, sizeof(*(ptr)));             \
18
     (void)0; })
19
 
20
#endif /* _ASM_GENERIC_UNALIGNED_H */

powered by: WebSVN 2.1.0

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