diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-10-12 12:31:20 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-14 05:33:05 -0400 |
commit | a771fe6e4e3e58f2056823ef9c30a554ec48f453 (patch) | |
tree | 06f60c5b96bd4b7c1690f86b0e44d74f6e3ffcc9 /arch/arm/kernel/entry-header.S | |
parent | 80f506918fdaaca6b574ba931536a58ce015c7be (diff) |
ARM: 5757/1: Thumb-2: Correct "mov.w pc, lr" instruction which is unpredictable
The 32-bit wide variant of "mov pc, reg" in Thumb-2 is unpredictable
causing improper handling of the undefined instructions not caught by
the kernel. This patch adds a movw_pc macro for such situations
(currently only used in call_fpe).
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/entry-header.S')
-rw-r--r-- | arch/arm/kernel/entry-header.S | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index ac34c0d9384b..7e9ed1eea40a 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -110,6 +110,13 @@ | |||
110 | mov \rd, sp, lsr #13 | 110 | mov \rd, sp, lsr #13 |
111 | mov \rd, \rd, lsl #13 | 111 | mov \rd, \rd, lsl #13 |
112 | .endm | 112 | .endm |
113 | |||
114 | @ | ||
115 | @ 32-bit wide "mov pc, reg" | ||
116 | @ | ||
117 | .macro movw_pc, reg | ||
118 | mov pc, \reg | ||
119 | .endm | ||
113 | #else /* CONFIG_THUMB2_KERNEL */ | 120 | #else /* CONFIG_THUMB2_KERNEL */ |
114 | .macro svc_exit, rpsr | 121 | .macro svc_exit, rpsr |
115 | clrex @ clear the exclusive monitor | 122 | clrex @ clear the exclusive monitor |
@@ -146,6 +153,14 @@ | |||
146 | lsr \rd, \rd, #13 | 153 | lsr \rd, \rd, #13 |
147 | mov \rd, \rd, lsl #13 | 154 | mov \rd, \rd, lsl #13 |
148 | .endm | 155 | .endm |
156 | |||
157 | @ | ||
158 | @ 32-bit wide "mov pc, reg" | ||
159 | @ | ||
160 | .macro movw_pc, reg | ||
161 | mov pc, \reg | ||
162 | nop | ||
163 | .endm | ||
149 | #endif /* !CONFIG_THUMB2_KERNEL */ | 164 | #endif /* !CONFIG_THUMB2_KERNEL */ |
150 | 165 | ||
151 | /* | 166 | /* |