diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2009-09-18 18:27:07 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2009-09-18 18:30:11 -0400 |
commit | 83e686ea0291ee93b87dcdc00b96443b80de56c9 (patch) | |
tree | 7c0adedcdb2a5838bc734ce6cf84a65563ea8c7a | |
parent | 74109b8913277b1dbd072039d1e0a930d2834389 (diff) |
Thumb-2: Correctly handle undefined instructions in the kernel
VFP instructions in the kernel may trigger undefined exceptions if VFP
hardware is not present. This patch corrects the loading of such Thumb-2
instructions. It also marks the "no_fp" label as a function so that the
linker generate a Thumb address.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index a332bc7225bf..0a2ba51cf35d 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -272,7 +272,15 @@ __und_svc: | |||
272 | @ | 272 | @ |
273 | @ r0 - instruction | 273 | @ r0 - instruction |
274 | @ | 274 | @ |
275 | #ifndef CONFIG_THUMB2_KERNEL | ||
275 | ldr r0, [r2, #-4] | 276 | ldr r0, [r2, #-4] |
277 | #else | ||
278 | ldrh r0, [r2, #-2] @ Thumb instruction at LR - 2 | ||
279 | and r9, r0, #0xf800 | ||
280 | cmp r9, #0xe800 @ 32-bit instruction if xx >= 0 | ||
281 | ldrhhs r9, [r2] @ bottom 16 bits | ||
282 | orrhs r0, r9, r0, lsl #16 | ||
283 | #endif | ||
276 | adr r9, BSYM(1f) | 284 | adr r9, BSYM(1f) |
277 | bl call_fpe | 285 | bl call_fpe |
278 | 286 | ||
@@ -678,7 +686,9 @@ ENTRY(fp_enter) | |||
678 | .word no_fp | 686 | .word no_fp |
679 | .previous | 687 | .previous |
680 | 688 | ||
681 | no_fp: mov pc, lr | 689 | ENTRY(no_fp) |
690 | mov pc, lr | ||
691 | ENDPROC(no_fp) | ||
682 | 692 | ||
683 | __und_usr_unknown: | 693 | __und_usr_unknown: |
684 | enable_irq | 694 | enable_irq |