Hi,
I am trying to bring up CPU1 on ARM v7 architecture (assume CPU0 already bring up & set c-environment)
using below code, but it hitting with error: "stack smashing detected"
ldr sp, =cpu1_stack
b start_task2
* cpu1_stack define here :
int new_stack[1024]__attribute__ ((aligned(16)))
I used PSCI framework to switch to cpu1
Please share some pointers/inputs whats going wrong here.
However, if Peter happens to see this, I'm quite sure he would be able to give a more helpful answer
No pressure
To get the current CPU ID you'll need to use some assembler to access the System Control co-processor. You don't say what CPU you are using, but assuming some form of ARMv7A CortexA core you'll need to look at the bottom two bits of the Multiprocessor Affinity Register.
For ARM-v7 32-bit code see: ARM Information Center
For ARMv8 64-bit code see: ARM Information Center
HTH, Pete