This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit fb391e6ba39eb1d5b12abe9c6ce923b3f9e57950 Author: hujun5 <[email protected]> AuthorDate: Mon Nov 3 21:08:30 2025 +0800 arm64: change CONFIG_SMP_NCPUS to CONFIG_NCPUS change CONFIG_SMP_NCPUS to CONFIG_NCPUS Signed-off-by: hujun5 <[email protected]> --- arch/arm64/src/common/arm64_cpuidlestack.c | 4 +- arch/arm64/src/common/arm64_cpustart.c | 74 +++++++++++++++--------------- arch/arm64/src/common/arm64_initialize.c | 8 ++-- arch/arm64/src/common/arm64_internal.h | 8 ++-- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/arch/arm64/src/common/arm64_cpuidlestack.c b/arch/arm64/src/common/arm64_cpuidlestack.c index 0bd165dd0da..7453543031b 100644 --- a/arch/arm64/src/common/arm64_cpuidlestack.c +++ b/arch/arm64/src/common/arm64_cpuidlestack.c @@ -90,10 +90,10 @@ int up_cpu_idlestack(int cpu, struct tcb_s *tcb, size_t stack_size) { -#if CONFIG_SMP_NCPUS > 1 +#ifndef CONFIG_UP uintptr_t stack_alloc; - DEBUGASSERT(cpu > 0 && cpu < CONFIG_SMP_NCPUS && tcb != NULL && + DEBUGASSERT(cpu < CONFIG_NCPUS && tcb != NULL && stack_size <= SMP_STACK_SIZE); /* Get the top of the stack */ diff --git a/arch/arm64/src/common/arm64_cpustart.c b/arch/arm64/src/common/arm64_cpustart.c index 848f7cc522a..5ba175c9478 100644 --- a/arch/arm64/src/common/arm64_cpustart.c +++ b/arch/arm64/src/common/arm64_cpustart.c @@ -56,65 +56,65 @@ * Public data ****************************************************************************/ -uint64_t *const g_cpu_int_stacktop[CONFIG_SMP_NCPUS] = +uint64_t *const g_cpu_int_stacktop[CONFIG_NCPUS] = { (uint64_t *)(g_interrupt_stacks[0] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 1 +#if CONFIG_NCPUS > 1 (uint64_t *)(g_interrupt_stacks[1] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 2 +#if CONFIG_NCPUS > 2 (uint64_t *)(g_interrupt_stacks[2] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 3 +#if CONFIG_NCPUS > 3 (uint64_t *)(g_interrupt_stacks[3] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 4 +#if CONFIG_NCPUS > 4 (uint64_t *)(g_interrupt_stacks[4] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 5 +#if CONFIG_NCPUS > 5 (uint64_t *)(g_interrupt_stacks[5] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 6 +#if CONFIG_NCPUS > 6 (uint64_t *)(g_interrupt_stacks[6] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 7 +#if CONFIG_NCPUS > 7 (uint64_t *)(g_interrupt_stacks[7] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 8 -# error This logic needs to extended for CONFIG_SMP_NCPUS > 8 -#endif /* CONFIG_SMP_NCPUS > 8 */ -#endif /* CONFIG_SMP_NCPUS > 7 */ -#endif /* CONFIG_SMP_NCPUS > 6 */ -#endif /* CONFIG_SMP_NCPUS > 5 */ -#endif /* CONFIG_SMP_NCPUS > 4 */ -#endif /* CONFIG_SMP_NCPUS > 3 */ -#endif /* CONFIG_SMP_NCPUS > 2 */ -#endif /* CONFIG_SMP_NCPUS > 1 */ +#if CONFIG_NCPUS > 8 +# error This logic needs to extended for CONFIG_NCPUS > 8 +#endif /* CONFIG_NCPUS > 8 */ +#endif /* CONFIG_NCPUS > 7 */ +#endif /* CONFIG_NCPUS > 6 */ +#endif /* CONFIG_NCPUS > 5 */ +#endif /* CONFIG_NCPUS > 4 */ +#endif /* CONFIG_NCPUS > 3 */ +#endif /* CONFIG_NCPUS > 2 */ +#endif /* CONFIG_NCPUS > 1 */ }; uint32_t g_smp_busy_wait_flag; #ifdef CONFIG_ARCH_HIPRI_INTERRUPT -uint64_t *const g_cpu_int_fiq_stacktop[CONFIG_SMP_NCPUS] = +uint64_t *const g_cpu_int_fiq_stacktop[CONFIG_NCPUS] = { (uint64_t *)(g_interrupt_fiq_stacks[0] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 1 +#if CONFIG_NCPUS > 1 (uint64_t *)(g_interrupt_fiq_stacks[1] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 2 +#if CONFIG_NCPUS > 2 (uint64_t *)(g_interrupt_fiq_stacks[2] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 3 +#if CONFIG_NCPUS > 3 (uint64_t *)(g_interrupt_fiq_stacks[3] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 4 +#if CONFIG_NCPUS > 4 (uint64_t *)(g_interrupt_fiq_stacks[4] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 5 +#if CONFIG_NCPUS > 5 (uint64_t *)(g_interrupt_fiq_stacks[5] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 6 +#if CONFIG_NCPUS > 6 (uint64_t *)(g_interrupt_fiq_stacks[6] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 7 +#if CONFIG_NCPUS > 7 (uint64_t *)(g_interrupt_fiq_stacks[7] + INTSTACK_SIZE), -#if CONFIG_SMP_NCPUS > 8 -# error This logic needs to extended for CONFIG_SMP_NCPUS > 8 -#endif /* CONFIG_SMP_NCPUS > 8 */ -#endif /* CONFIG_SMP_NCPUS > 7 */ -#endif /* CONFIG_SMP_NCPUS > 6 */ -#endif /* CONFIG_SMP_NCPUS > 5 */ -#endif /* CONFIG_SMP_NCPUS > 4 */ -#endif /* CONFIG_SMP_NCPUS > 3 */ -#endif /* CONFIG_SMP_NCPUS > 2 */ -#endif /* CONFIG_SMP_NCPUS > 1 */ +#if CONFIG_NCPUS > 8 +# error This logic needs to extended for CONFIG_NCPUS > 8 +#endif /* CONFIG_NCPUS > 8 */ +#endif /* CONFIG_NCPUS > 7 */ +#endif /* CONFIG_NCPUS > 6 */ +#endif /* CONFIG_NCPUS > 5 */ +#endif /* CONFIG_NCPUS > 4 */ +#endif /* CONFIG_NCPUS > 3 */ +#endif /* CONFIG_NCPUS > 2 */ +#endif /* CONFIG_NCPUS > 1 */ }; #endif @@ -216,7 +216,7 @@ static void arm64_start_cpu(int cpu_num) int up_cpu_start(int cpu) { - DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu()); + DEBUGASSERT(cpu >= 0 && cpu < CONFIG_NCPUS && cpu != this_cpu()); #ifdef CONFIG_SCHED_INSTRUMENTATION diff --git a/arch/arm64/src/common/arm64_initialize.c b/arch/arm64/src/common/arm64_initialize.c index f6cfce8b8d1..ac6bf3187ce 100644 --- a/arch/arm64/src/common/arm64_initialize.c +++ b/arch/arm64/src/common/arm64_initialize.c @@ -56,14 +56,14 @@ static struct notifier_block g_fpu_panic_block; #endif -#ifdef CONFIG_SMP -INIT_STACK_ARRAY_DEFINE(g_cpu_idlestackalloc, CONFIG_SMP_NCPUS, +#if CONFIG_NCPUS > 1 +INIT_STACK_ARRAY_DEFINE(g_cpu_idlestackalloc, CONFIG_NCPUS, SMP_STACK_SIZE); -INIT_STACK_ARRAY_DEFINE(g_interrupt_stacks, CONFIG_SMP_NCPUS, +INIT_STACK_ARRAY_DEFINE(g_interrupt_stacks, CONFIG_NCPUS, INTSTACK_SIZE); #ifdef CONFIG_ARCH_HIPRI_INTERRUPT -INIT_STACK_ARRAY_DEFINE(g_interrupt_fiq_stacks, CONFIG_SMP_NCPUS, +INIT_STACK_ARRAY_DEFINE(g_interrupt_fiq_stacks, CONFIG_NCPUS, INTSTACK_SIZE); #endif diff --git a/arch/arm64/src/common/arm64_internal.h b/arch/arm64/src/common/arm64_internal.h index ad9efabdaa0..1cd038b7625 100644 --- a/arch/arm64/src/common/arm64_internal.h +++ b/arch/arm64/src/common/arm64_internal.h @@ -151,15 +151,15 @@ extern "C" #define INTSTACK_SIZE STACKFRAME_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK) -#ifdef CONFIG_SMP +#ifndef CONFIG_UP -INIT_STACK_ARRAY_DEFINE_EXTERN(g_cpu_idlestackalloc, CONFIG_SMP_NCPUS, +INIT_STACK_ARRAY_DEFINE_EXTERN(g_cpu_idlestackalloc, CONFIG_NCPUS, SMP_STACK_SIZE); -INIT_STACK_ARRAY_DEFINE_EXTERN(g_interrupt_stacks, CONFIG_SMP_NCPUS, +INIT_STACK_ARRAY_DEFINE_EXTERN(g_interrupt_stacks, CONFIG_NCPUS, INTSTACK_SIZE); #ifdef CONFIG_ARCH_HIPRI_INTERRUPT -INIT_STACK_ARRAY_DEFINE_EXTERN(g_interrupt_fiq_stacks, CONFIG_SMP_NCPUS, +INIT_STACK_ARRAY_DEFINE_EXTERN(g_interrupt_fiq_stacks, CONFIG_NCPUS, INTSTACK_SIZE); #endif #else
