Nobuhiro Iwamatsu | da5e083 | 2010-02-08 11:50:16 +0900 | [diff] [blame] | 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. */ |
Masahiro Yamada | afc366f | 2014-11-26 16:00:58 +0900 | [diff] [blame] | 11 | #include <linux/compiler.h> |
Nobuhiro Iwamatsu | da5e083 | 2010-02-08 11:50:16 +0900 | [diff] [blame] | 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 */ |