xref: /openbmc/u-boot/arch/sh/include/asm/unaligned.h (revision ebce73f0)
1 #ifndef _ASM_SH_UNALIGNED_H
2 #define _ASM_SH_UNALIGNED_H
3 
4 /* Copy from linux-kernel. */
5 
6 #ifdef CONFIG_CPU_SH4A
7 /* SH-4A can handle unaligned loads in a relatively neutered fashion. */
8 #include <asm/unaligned-sh4a.h>
9 #else
10 /* Otherwise, SH can't handle unaligned accesses. */
11 #include <linux/compiler.h>
12 #if defined(__BIG_ENDIAN__)
13 #define get_unaligned   __get_unaligned_be
14 #define put_unaligned   __put_unaligned_be
15 #elif defined(__LITTLE_ENDIAN__)
16 #define get_unaligned   __get_unaligned_le
17 #define put_unaligned   __put_unaligned_le
18 #endif
19 
20 #include <linux/unaligned/le_byteshift.h>
21 #include <linux/unaligned/be_byteshift.h>
22 #include <linux/unaligned/generic.h>
23 #endif
24 
25 #endif /* _ASM_SH_UNALIGNED_H */
26