summaryrefslogtreecommitdiff
path: root/arch/arm/kernel/entry-header.S
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-10-12 17:31:20 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-10-14 10:33:05 +0100
commita771fe6e4e3e58f2056823ef9c30a554ec48f453 (patch)
tree06f60c5b96bd4b7c1690f86b0e44d74f6e3ffcc9 /arch/arm/kernel/entry-header.S
parent80f506918fdaaca6b574ba931536a58ce015c7be (diff)
downloadlwn-a771fe6e4e3e58f2056823ef9c30a554ec48f453.tar.gz
lwn-a771fe6e4e3e58f2056823ef9c30a554ec48f453.zip
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.S15
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 @@
mov \rd, sp, lsr #13
mov \rd, \rd, lsl #13
.endm
+
+ @
+ @ 32-bit wide "mov pc, reg"
+ @
+ .macro movw_pc, reg
+ mov pc, \reg
+ .endm
#else /* CONFIG_THUMB2_KERNEL */
.macro svc_exit, rpsr
clrex @ clear the exclusive monitor
@@ -146,6 +153,14 @@
lsr \rd, \rd, #13
mov \rd, \rd, lsl #13
.endm
+
+ @
+ @ 32-bit wide "mov pc, reg"
+ @
+ .macro movw_pc, reg
+ mov pc, \reg
+ nop
+ .endm
#endif /* !CONFIG_THUMB2_KERNEL */
/*