From 6ea749de528387c1e897563b566dfe8a8cf61d90 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 8 Nov 2023 09:05:17 -0800 Subject: [PATCH] arch: rename arch_start_cpu() to arch_cpu_start() Rename arch_start_cpu() to arch_cpu_start() so it belongs to the "cpu" namespace. Signed-off-by: Daniel Leung --- arch/arc/core/smp.c | 4 ++-- arch/arm/core/cortex_a_r/smp.c | 2 +- arch/arm64/core/smp.c | 2 +- arch/riscv/core/smp.c | 2 +- arch/x86/core/intel64/cpu.c | 2 +- doc/kernel/services/smp/smp.rst | 2 +- doc/kernel/services/smp/smpinit.svg | 2 +- doc/releases/migration-guide-3.7.rst | 2 ++ include/zephyr/arch/arch_interface.h | 2 +- kernel/smp.c | 2 +- soc/espressif/esp32/esp32-mp.c | 2 +- soc/intel/intel_adsp/common/multiprocessing.c | 4 ++-- tests/kernel/mp/src/main.c | 6 +++--- tests/kernel/spinlock/src/main.c | 2 +- 14 files changed, 19 insertions(+), 17 deletions(-) diff --git a/arch/arc/core/smp.c b/arch/arc/core/smp.c index 6bc89883fa..767c463180 100644 --- a/arch/arc/core/smp.c +++ b/arch/arc/core/smp.c @@ -39,7 +39,7 @@ volatile char *arc_cpu_sp; volatile _cpu_t *_curr_cpu[CONFIG_MP_MAX_NUM_CPUS]; /* Called from Zephyr initialization */ -void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz, +void arch_cpu_start(int cpu_num, k_thread_stack_t *stack, int sz, arch_cpustart_t fn, void *arg) { _curr_cpu[cpu_num] = &(_kernel.cpus[cpu_num]); @@ -114,7 +114,7 @@ void arch_secondary_cpu_init(int cpu_num) DT_IRQ(DT_NODELABEL(ici), priority), 0); irq_enable(DT_IRQN(DT_NODELABEL(ici))); #endif - /* call the function set by arch_start_cpu */ + /* call the function set by arch_cpu_start */ fn = arc_cpu_init[cpu_num].fn; fn(arc_cpu_init[cpu_num].arg); diff --git a/arch/arm/core/cortex_a_r/smp.c b/arch/arm/core/cortex_a_r/smp.c index f581c77031..85a8650d02 100644 --- a/arch/arm/core/cortex_a_r/smp.c +++ b/arch/arm/core/cortex_a_r/smp.c @@ -90,7 +90,7 @@ extern int z_arm_mmu_init(void); #endif /* Called from Zephyr initialization */ -void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz, arch_cpustart_t fn, void *arg) +void arch_cpu_start(int cpu_num, k_thread_stack_t *stack, int sz, arch_cpustart_t fn, void *arg) { int cpu_count, i, j; uint32_t cpu_mpid = 0; diff --git a/arch/arm64/core/smp.c b/arch/arm64/core/smp.c index 76ccd77090..3413a57802 100644 --- a/arch/arm64/core/smp.c +++ b/arch/arm64/core/smp.c @@ -62,7 +62,7 @@ static uint64_t cpu_map[CONFIG_MP_MAX_NUM_CPUS] = { extern void z_arm64_mm_init(bool is_primary_core); /* Called from Zephyr initialization */ -void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz, +void arch_cpu_start(int cpu_num, k_thread_stack_t *stack, int sz, arch_cpustart_t fn, void *arg) { int cpu_count; diff --git a/arch/riscv/core/smp.c b/arch/riscv/core/smp.c index 54de29c055..fe9f349f6b 100644 --- a/arch/riscv/core/smp.c +++ b/arch/riscv/core/smp.c @@ -27,7 +27,7 @@ extern void __start(void); void soc_interrupt_init(void); #endif -void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz, +void arch_cpu_start(int cpu_num, k_thread_stack_t *stack, int sz, arch_cpustart_t fn, void *arg) { riscv_cpu_init[cpu_num].fn = fn; diff --git a/arch/x86/core/intel64/cpu.c b/arch/x86/core/intel64/cpu.c index 2a845960b8..f5b3af53fa 100644 --- a/arch/x86/core/intel64/cpu.c +++ b/arch/x86/core/intel64/cpu.c @@ -138,7 +138,7 @@ struct x86_cpuboot x86_cpuboot[] = { * will enter the kernel at fn(arg), running on the specified stack. */ -void arch_start_cpu(int cpu_num, k_thread_stack_t *stack, int sz, +void arch_cpu_start(int cpu_num, k_thread_stack_t *stack, int sz, arch_cpustart_t fn, void *arg) { #if CONFIG_MP_MAX_NUM_CPUS > 1 diff --git a/doc/kernel/services/smp/smp.rst b/doc/kernel/services/smp/smp.rst index 0a94ed022b..ca1e0149ad 100644 --- a/doc/kernel/services/smp/smp.rst +++ b/doc/kernel/services/smp/smp.rst @@ -132,7 +132,7 @@ happens on a single CPU before other CPUs are brought online. Just before entering the application :c:func:`main` function, the kernel calls :c:func:`z_smp_init` to launch the SMP initialization process. This enumerates over the configured CPUs, calling into the architecture -layer using :c:func:`arch_start_cpu` for each one. This function is +layer using :c:func:`arch_cpu_start` for each one. This function is passed a memory region to use as a stack on the foreign CPU (in practice it uses the area that will become that CPU's interrupt stack), the address of a local :c:func:`smp_init_top` callback function to diff --git a/doc/kernel/services/smp/smpinit.svg b/doc/kernel/services/smp/smpinit.svg index 13227081b0..7495df7831 100644 --- a/doc/kernel/services/smp/smpinit.svg +++ b/doc/kernel/services/smp/smpinit.svg @@ -309,7 +309,7 @@ id="tspan3682" x="33.970718" y="46.338062" - style="stroke-width:0.34572953">arch_start_cpu() + style="stroke-width:0.34572953">arch_cpu_start()