x86: Fix build when optimizations are disabled

When building without optimizations and with only one core the linker
does not throw away arch_start_cpu and we get an undefined reference to
x86_ap_start

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2023-11-16 17:50:00 +00:00 committed by Carles Cufí
commit 9f70cd557b

View file

@ -141,6 +141,7 @@ struct x86_cpuboot x86_cpuboot[] = {
void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
arch_cpustart_t fn, void *arg)
{
#if CONFIG_MP_MAX_NUM_CPUS > 1
uint8_t vector = ((unsigned long) x86_ap_start) >> 12;
uint8_t apic_id;
@ -166,6 +167,13 @@ void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz,
while (x86_cpuboot[cpu_num].ready == 0) {
}
#else
ARG_UNUSED(cpu_num);
ARG_UNUSED(stack);
ARG_UNUSED(sz);
ARG_UNUSED(fn);
ARG_UNUSED(arg);
#endif
}
/* Per-CPU initialization, C domain. On the first CPU, z_x86_prep_c is the