diff --git a/arch/arm/src/armv7-a/arm_cpuhead.S b/arch/arm/src/armv7-a/arm_cpuhead.S index 412029bc474..be95869e3db 100644 --- a/arch/arm/src/armv7-a/arm_cpuhead.S +++ b/arch/arm/src/armv7-a/arm_cpuhead.S @@ -101,6 +101,12 @@ __cpu1_start: b .Lcpu_start + .globl cpu1_start + .type cpu1_start, object + + cpu1_start: + .long __cpu1_start + .Lcpu1_stackpointer: .long .Lcpu1_stacktop .size __cpu1_start, .-__cpu1_start @@ -124,6 +130,12 @@ __cpu2_start: b .Lcpu_start + .globl cpu2_start + .type cpu2_start, object + + cpu2_start: + .long __cpu2_start + .Lcpu2_stackpointer: .long .Lcpu2_stacktop .size __cpu2_start, .-__cpu2_start @@ -147,6 +159,12 @@ __cpu3_start: b .Lcpu_start + .globl cpu3_start + .type cpu3_start, object + + cpu3_start: + .long __cpu3_start + .Lcpu3_stackpointer: .long .Lcpu3_stacktop .size __cpu3_start, .-__cpu3_start diff --git a/arch/arm/src/armv7-a/arm_head.S b/arch/arm/src/armv7-a/arm_head.S index fe23be41c0c..6abc2a26e89 100644 --- a/arch/arm/src/armv7-a/arm_head.S +++ b/arch/arm/src/armv7-a/arm_head.S @@ -197,19 +197,24 @@ __start: wfe #endif + ldr r1, =cpu1_start + ldr r1, [r1] cmp r0, #1 - beq __cpu1_start + bxeq r1 # if CONFIG_NCPUS > 2 + ldr r1, =cpu2_start + ldr r1, [r1] cmp r0, #2 - beq __cpu2_start + bxeq r1 # endif # if CONFIG_NCPUS > 3 + ldr r1, =cpu3_start + ldr r1, [r1] cmp r0, #3 - beq __cpu3_start + bxeq r1 # endif # if CONFIG_NCPUS > 4 - cmp r0, #4 - beq __cpu4_start +# error This logic needs to extended for CONFIG_SMP_NCPUS > 4 # endif __cpu0_start: diff --git a/arch/arm/src/armv7-r/arm_cpuhead.S b/arch/arm/src/armv7-r/arm_cpuhead.S index 8044fd11d57..18970ec99bd 100644 --- a/arch/arm/src/armv7-r/arm_cpuhead.S +++ b/arch/arm/src/armv7-r/arm_cpuhead.S @@ -127,6 +127,12 @@ __cpu1_start: b .Lcpu_start + .globl cpu1_start + .type cpu1_start, object + + cpu1_start: + .long __cpu1_start + .Lcpu1_stackpointer: .long .Lcpu1_stacktop .size __cpu1_start, .-__cpu1_start @@ -150,6 +156,12 @@ __cpu2_start: b .Lcpu_start + .globl cpu2_start + .type cpu2_start, object + + cpu2_start: + .long __cpu2_start + .Lcpu2_stackpointer: .long .Lcpu2_stacktop .size __cpu2_start, .-__cpu2_start @@ -173,6 +185,12 @@ __cpu3_start: b .Lcpu_start + .globl cpu3_start + .type cpu3_start, object + + cpu3_start: + .long __cpu3_start + .Lcpu3_stackpointer: .long .Lcpu3_stacktop .size __cpu3_start, .-__cpu3_start diff --git a/arch/arm/src/armv7-r/arm_head.S b/arch/arm/src/armv7-r/arm_head.S index 5d8e254bedf..8d63ad25140 100644 --- a/arch/arm/src/armv7-r/arm_head.S +++ b/arch/arm/src/armv7-r/arm_head.S @@ -145,19 +145,24 @@ __start: wfe #endif + ldr r1, =cpu1_start + ldr r1, [r1] cmp r0, #1 - beq __cpu1_start + bxeq r1 # if CONFIG_NCPUS > 2 + ldr r1, =cpu2_start + ldr r1, [r1] cmp r0, #2 - beq __cpu2_start + bxeq r1 # endif # if CONFIG_NCPUS > 3 + ldr r1, =cpu3_start + ldr r1, [r1] cmp r0, #3 - beq __cpu3_start + bxeq r1 # endif # if CONFIG_NCPUS > 4 - cmp r0, #4 - beq __cpu4_start +# error This logic needs to extended for CONFIG_SMP_NCPUS > 4 # endif __cpu0_start: