xtensa: add calling entry point for multi-processing

Under multi-processing, only the first CPU#0 needs to go through
setting up the kernel structs and clearing out BSS (among others).
There is no need for other CPUs to do those tasks. Since each
Xtensa core starts using the same boot vector, CPUs other than #0
need to skip all the startup tasks by not calling to z_cstart().
So provide another entry point for those CPUs. Note that Xtensa
arch is highly configurable. So the implementation of the entry
point is up to each individual SoC config.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2019-12-26 12:06:28 -08:00 committed by Anas Nashif
parent ad2ee13c27
commit 5539c3ed90

View file

@ -23,6 +23,7 @@
.global __start
.type z_cstart, @function
.type z_mp_entry, @function
/* Macros to abstract away ABI differences */
@ -185,6 +186,19 @@ _start:
#endif /* !XCHAL_HAVE_BOOTLOADER */
#ifdef CONFIG_SMP
/*
* z_cstart() is only for CPU #0.
* Other CPUs have different entry point.
*/
rsr a3, PRID
extui a3, a3, 0, 8 /* extract core ID */
beqz a3, 2f
CALL z_mp_entry
2:
#endif /* CONFIG_SMP */
/* Enter C domain, never returns from here */
CALL z_cstart