sh: Provide optimized unaligned loads on SH-4A.
This adds support for unaligned loads on SH-4A, using the SH-4A's neutered movua.l instruction. As movua.l is r0-inspired, stores are still handled through the packed struct. Based on asm-generic/unaligned.h by Harvey Harrison. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
#ifndef _ASM_SH_UNALIGNED_H
|
||||
#define _ASM_SH_UNALIGNED_H
|
||||
|
||||
/* SH can't handle unaligned accesses. */
|
||||
#ifdef CONFIG_CPU_SH4A
|
||||
/* SH-4A can handle unaligned loads in a relatively neutered fashion. */
|
||||
#include <asm/unaligned-sh4a.h>
|
||||
#else
|
||||
/* Otherwise, SH can't handle unaligned accesses. */
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
# include <linux/unaligned/le_struct.h>
|
||||
# include <linux/unaligned/be_byteshift.h>
|
||||
@@ -15,5 +19,6 @@
|
||||
# define get_unaligned __get_unaligned_be
|
||||
# define put_unaligned __put_unaligned_be
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_SH_UNALIGNED_H */
|
||||
|
Reference in New Issue
Block a user