ADD THE SLIDER CODE HERE

2011年8月18日 星期四

Error: selected processor does not support ARM mode `smc #0'

Question:
I want to compile a vendor-provided old Linux kernel tree (kernel version 2.6.32) with ELDK 5.0 for the armv7a configuration. Unfortunately this fails with errors like this one:
...
  CC      arch/arm/kernel/sysfs_v7.o
/tmp/ccwkv7On.s: Assembler messages:
/tmp/ccwkv7On.s:249: Error: selected processor does not support ARM mode `smc #0'
/tmp/ccwkv7On.s:289: Error: selected processor does not support ARM mode `smc #0'
make[1]: *** [arch/arm/kernel/sysfs_v7.o] Error 1
Answer:
Your kernel tree is too old for the ELDK 5.0 tool chain. You can work around this problem by applying the following patch to your kernel tree:
--- arch/arm/kernel/sysfs_v7.c.ORIG   2011-01-27 11:47:54.000000000 +0100
+++ arch/arm/kernel/sysfs_v7.c   2011-05-10 08:51:58.953252638 +0200
@@ -76,7 +76,8 @@
    asm ("mrc p15, 0, %0, c1, c0, 1" : "=r"(val));
    SETBITS(val, 0xff8, new);
    val &= ~2;
-   asm ("mov r0,  %0   \n\t"
+   asm (".arch_extension sec\n\t"
+        "mov r0,  %0   \n\t"
         "mov r12, #3   \n\t"
         "smc #0      \n\t"
         :: "r"(val) : "r0", "r12");
@@ -107,7 +108,8 @@
 
    asm ("mrc p15, 1, %0, c9, c0, 2" : "=r"(val));
    SETBITS(val, 0xbc00000, new);
-   asm ("mov r0,  %0   \n\t"
+   asm (".arch_extension sec\n\t"
+        "mov r0,  %0   \n\t"
         "mov r12, #2   \n\t"
         "smc #0      \n\t"
         :: "r"(val) : "r0", "r12");

沒有留言:

張貼留言