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:
Paul Mundt
2008-11-26 00:29:58 +09:00
parent 716777db72
commit 95b781c239
2 changed files with 264 additions and 1 deletions

View File

@@ -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 */