]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] VFP: fix section mismatch error
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sun, 10 Jun 2007 11:22:20 +0000 (12:22 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 10 Jun 2007 11:22:20 +0000 (12:22 +0100)
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>
arch/arm/vfp/entry.S
arch/arm/vfp/vfpmodule.c
include/asm-arm/linkage.h

index ca2a5ad19ea6a65ce9ee1c871a5b06fdcc9fab86..806ce26d524324dedd9c45d7ec1f5fcc8b35cc92 100644 (file)
@@ -29,6 +29,10 @@ do_vfp:
        add     r10, r10, #TI_VFPSTATE  @ r10 = workspace
        ldr     pc, [r4]                @ call VFP entry point
 
+ENTRY(vfp_null_entry)
+       mov     pc, lr
+ENDPROC(vfp_null_entry)
+
 .LCvfp:
        .word   vfp_vector
 
index f1e5951dc72188ce86c9ae880ccbef79621ae327..1106b5f9cf197bffda116df9562511374ffd7bd9 100644 (file)
@@ -26,8 +26,9 @@
  */
 void vfp_testing_entry(void);
 void vfp_support_entry(void);
+void vfp_null_entry(void);
 
-void (*vfp_vector)(void) = vfp_testing_entry;
+void (*vfp_vector)(void) = vfp_null_entry;
 union vfp_state *last_VFP_context[NR_CPUS];
 
 /*
@@ -321,8 +322,10 @@ static int __init vfp_init(void)
         * The handler is already setup to just log calls, so
         * we just need to read the VFPSID register.
         */
+       vfp_vector = vfp_testing_entry;
        vfpsid = fmrx(FPSID);
        barrier();
+       vfp_vector = vfp_null_entry;
 
        printk(KERN_INFO "VFP support v0.3: ");
        if (VFP_arch) {
index dbe4b4e31a5b5d39026d955ff34463227fffe3ef..5a25632b1bc079aac63f66af28cb5447b80bf2de 100644 (file)
@@ -4,4 +4,8 @@
 #define __ALIGN .align 0
 #define __ALIGN_STR ".align 0"
 
+#define ENDPROC(name) \
+  .type name, %function; \
+  END(name)
+
 #endif