Commit 77dcf91f authored by Kumar Gala's avatar Kumar Gala Committed by Carles Cufi
Browse files

smp: define arch_num_cpus always



Move arch_num_cpus outside of CONFIG_SMP in sys/arch_interface.h and
add define arch_num_cpus on all platforms (added arch_inlines.h on
those platforms that didn't have it before).

Signed-off-by: default avatarKumar Gala <kumar.gala@intel.com>
parent 938b9533
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -24,6 +24,16 @@
#include <zephyr/arch/xtensa/arch_inlines.h>
#elif defined(CONFIG_RISCV)
#include <zephyr/arch/riscv/arch_inlines.h>
#elif defined(CONFIG_NIOS2)
#include <zephyr/arch/nios2/arch_inlines.h>
#elif defined(CONFIG_MIPS)
#include <zephyr/arch/mips/arch_inlines.h>
#elif defined(CONFIG_ARCH_POSIX)
#include <zephyr/arch/posix/arch_inlines.h>
#elif defined(CONFIG_SPARC)
#include <zephyr/arch/sparc/arch_inlines.h>
#else
#error "Unknown Architecture"
#endif

#endif /* ZEPHYR_INCLUDE_ARCH_INLINES_H_ */
+17 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2022 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_INCLUDE_ARCH_MIPS_ARCH_INLINES_H
#define ZEPHYR_INCLUDE_ARCH_MIPS_ARCH_INLINES_H

#include <zephyr/kernel_structs.h>

static ALWAYS_INLINE unsigned int arch_num_cpus(void)
{
	return CONFIG_MP_MAX_NUM_CPUS;
}

#endif /* ZEPHYR_INCLUDE_ARCH_MIPS_ARCH_INLINES_H */
+17 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2022 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_INCLUDE_ARCH_NIOS2_ARCH_INLINES_H
#define ZEPHYR_INCLUDE_ARCH_NIOS2_ARCH_INLINES_H

#include <zephyr/kernel_structs.h>

static ALWAYS_INLINE unsigned int arch_num_cpus(void)
{
	return CONFIG_MP_MAX_NUM_CPUS;
}

#endif /* ZEPHYR_INCLUDE_ARCH_NIOS2_ARCH_INLINES_H */
+17 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2022 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_INCLUDE_ARCH_POSIX_ARCH_INLINES_H
#define ZEPHYR_INCLUDE_ARCH_POSIX_ARCH_INLINES_H

#include <zephyr/kernel_structs.h>

static ALWAYS_INLINE unsigned int arch_num_cpus(void)
{
	return CONFIG_MP_MAX_NUM_CPUS;
}

#endif /* ZEPHYR_INCLUDE_ARCH_POSIX_ARCH_INLINES_H */
+17 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2022 Intel Corporation
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_INCLUDE_ARCH_SPARC_ARCH_INLINES_H
#define ZEPHYR_INCLUDE_ARCH_SPARC_ARCH_INLINES_H

#include <zephyr/kernel_structs.h>

static ALWAYS_INLINE unsigned int arch_num_cpus(void)
{
	return CONFIG_MP_MAX_NUM_CPUS;
}

#endif /* ZEPHYR_INCLUDE_ARCH_SPARC_ARCH_INLINES_H */
Loading