diff --git a/arch/xtensa/core/crt1.S b/arch/xtensa/core/crt1.S index f1d718609e4..29881f707cc 100644 --- a/arch/xtensa/core/crt1.S +++ b/arch/xtensa/core/crt1.S @@ -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