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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [asm-sparc64/] [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
#ifndef _ASM_SPARC64_UNALIGNED_H_
2
#define _ASM_SPARC64_UNALIGNED_H_
3
 
4
/* Sparc can't handle unaligned accesses. */
5
 
6
#include <linux/string.h>
7
 
8
 
9
/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
10
 
11
#define get_unaligned(ptr) \
12
  ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
13
 
14
#define put_unaligned(val, ptr)                         \
15
  ({ __typeof__(*(ptr)) __tmp = (val);                  \
16
     memmove((ptr), &__tmp, sizeof(*(ptr)));            \
17
     (void)0; })
18
 
19
#endif /* _ASM_SPARC64_UNALIGNED_H */

powered by: WebSVN 2.1.0

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