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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-sh/] [unaligned.h] - Diff between revs 1275 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 1275 Rev 1765
#ifndef __ASM_SH_UNALIGNED_H
#ifndef __ASM_SH_UNALIGNED_H
#define __ASM_SH_UNALIGNED_H
#define __ASM_SH_UNALIGNED_H
 
 
/* SH can't handle unaligned accesses. */
/* SH can't handle unaligned accesses. */
 
 
#include <linux/string.h>
#include <linux/string.h>
 
 
 
 
/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
 
 
#define get_unaligned(ptr) \
#define get_unaligned(ptr) \
  ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
  ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
 
 
#define put_unaligned(val, ptr)                         \
#define put_unaligned(val, ptr)                         \
  ({ __typeof__(*(ptr)) __tmp = (val);                  \
  ({ __typeof__(*(ptr)) __tmp = (val);                  \
     memmove((ptr), &__tmp, sizeof(*(ptr)));            \
     memmove((ptr), &__tmp, sizeof(*(ptr)));            \
     (void)0; })
     (void)0; })
 
 
#endif /* __ASM_SH_UNALIGNED_H */
#endif /* __ASM_SH_UNALIGNED_H */
 
 

powered by: WebSVN 2.1.0

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