aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/vfp
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-06-10 07:22:20 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-06-10 07:22:20 -0400
commit5d4cae5fe2ea1a0974962e2c49dca5c9c4b14cc0 (patch)
tree4f041d48181445ef55b1fedea7853d4fb2ef8f31 /arch/arm/vfp
parent845a2fdcbd5bc5b9f652201ee95c825827a1d521 (diff)
[ARM] VFP: fix section mismatch error
Fix a real section mismatch issue; the test code is thrown away after initialisation, but if we do not detect the VFP hardware, it is left hooked into the exception handler. Any VFP instructions which are subsequently executed risk calling the discarded exception handler. Introduce a new "null" handler which returns to the "unrecognised fault" return address. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/vfp')
-rw-r--r--arch/arm/vfp/entry.S4
-rw-r--r--arch/arm/vfp/vfpmodule.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
index ca2a5ad19ea6..806ce26d5243 100644
--- a/arch/arm/vfp/entry.S
+++ b/arch/arm/vfp/entry.S
@@ -29,6 +29,10 @@ do_vfp:
29 add r10, r10, #TI_VFPSTATE @ r10 = workspace 29 add r10, r10, #TI_VFPSTATE @ r10 = workspace
30 ldr pc, [r4] @ call VFP entry point 30 ldr pc, [r4] @ call VFP entry point
31 31
32ENTRY(vfp_null_entry)
33 mov pc, lr
34ENDPROC(vfp_null_entry)
35
32.LCvfp: 36.LCvfp:
33 .word vfp_vector 37 .word vfp_vector
34 38
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index f1e5951dc721..1106b5f9cf19 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -26,8 +26,9 @@
26 */ 26 */
27void vfp_testing_entry(void); 27void vfp_testing_entry(void);
28void vfp_support_entry(void); 28void vfp_support_entry(void);
29void vfp_null_entry(void);
29 30
30void (*vfp_vector)(void) = vfp_testing_entry; 31void (*vfp_vector)(void) = vfp_null_entry;
31union vfp_state *last_VFP_context[NR_CPUS]; 32union vfp_state *last_VFP_context[NR_CPUS];
32 33
33/* 34/*
@@ -321,8 +322,10 @@ static int __init vfp_init(void)
321 * The handler is already setup to just log calls, so 322 * The handler is already setup to just log calls, so
322 * we just need to read the VFPSID register. 323 * we just need to read the VFPSID register.
323 */ 324 */
325 vfp_vector = vfp_testing_entry;
324 vfpsid = fmrx(FPSID); 326 vfpsid = fmrx(FPSID);
325 barrier(); 327 barrier();
328 vfp_vector = vfp_null_entry;
326 329
327 printk(KERN_INFO "VFP support v0.3: "); 330 printk(KERN_INFO "VFP support v0.3: ");
328 if (VFP_arch) { 331 if (VFP_arch) {