Skip to content

Commit 4f458ba

Browse files
galakcarlescufi
authored andcommitted
kernel: Convert away from CONFIG_MP_NUM_CPUS
Move runtime code to use arch_num_cpus() instead of CONFIG_MP_NUM_CPUS and use CONFIG_MP_MAX_NUM_CPUS for ifdef and BUILD_ASSERT macros. Signed-off-by: Kumar Gala <[email protected]>
1 parent 1a5495a commit 4f458ba

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/zephyr/spinlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct k_spinlock {
8484
bool z_spin_lock_valid(struct k_spinlock *l);
8585
bool z_spin_unlock_valid(struct k_spinlock *l);
8686
void z_spin_lock_set_owner(struct k_spinlock *l);
87-
BUILD_ASSERT(CONFIG_MP_NUM_CPUS <= 4, "Too many CPUs for mask");
87+
BUILD_ASSERT(CONFIG_MP_MAX_NUM_CPUS <= 4, "Too many CPUs for mask");
8888

8989
# ifdef CONFIG_KERNEL_COHERENCE
9090
bool z_spin_lock_mem_coherent(struct k_spinlock *l);

kernel/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static void init_idle_thread(int i)
343343

344344
#ifdef CONFIG_THREAD_NAME
345345

346-
#if CONFIG_MP_NUM_CPUS > 1
346+
#if CONFIG_MP_MAX_NUM_CPUS > 1
347347
char tname[8];
348348
snprintk(tname, 8, "idle %02d", i);
349349
#else

kernel/sched.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static void signal_pending_ipi(void)
279279
* this code.
280280
*/
281281
#if defined(CONFIG_SMP) && defined(CONFIG_SCHED_IPI_SUPPORTED)
282-
if (CONFIG_MP_NUM_CPUS > 1) {
282+
if (arch_num_cpus() > 1) {
283283
if (_kernel.pending_ipi) {
284284
_kernel.pending_ipi = false;
285285
arch_sched_ipi();
@@ -608,7 +608,7 @@ static bool thread_active_elsewhere(struct k_thread *thread)
608608
static void flag_ipi(void)
609609
{
610610
#if defined(CONFIG_SMP) && defined(CONFIG_SCHED_IPI_SUPPORTED)
611-
if (CONFIG_MP_NUM_CPUS > 1) {
611+
if (arch_num_cpus() > 1) {
612612
_kernel.pending_ipi = true;
613613
}
614614
#endif
@@ -1611,7 +1611,7 @@ static inline int z_vrfy_k_is_preempt_thread(void)
16111611
#ifdef CONFIG_SCHED_CPU_MASK
16121612
# ifdef CONFIG_SMP
16131613
/* Right now we use a single byte for this mask */
1614-
BUILD_ASSERT(CONFIG_MP_NUM_CPUS <= 8, "Too many CPUs for mask word");
1614+
BUILD_ASSERT(CONFIG_MP_MAX_NUM_CPUS <= 8, "Too many CPUs for mask word");
16151615
# endif
16161616

16171617

0 commit comments

Comments
 (0)