diff --git a/arch/Kconfig b/arch/Kconfig index f916feb5b7347..584df27d4ded8 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -417,6 +417,11 @@ config ARCH_HAVE_MULTICPU bool default n +config ARCH_HAVE_CPUID_MAPPING + bool + default n + depends on ARCH_HAVE_MULTICPU + config ARCH_HAVE_FORK bool default n diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index a5d8b6280eeeb..88d3022ce2b52 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -111,6 +111,19 @@ # define up_cpu_index() 0 #endif /* CONFIG_ARCH_HAVE_MULTICPU */ +/**************************************************************************** + * Name: up_this_cpu + * + * Description: + * Return the logical core number. Default implementation is 1:1 mapping, + * i.e. physical=logical. + * + ****************************************************************************/ + +#ifndef CONFIG_ARCH_HAVE_CPUID_MAPPING +# define up_this_cpu() up_cpu_index() +#endif + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/include/nuttx/sched.h b/include/nuttx/sched.h index cfca51e5fce9e..7247f1f24838b 100644 --- a/include/nuttx/sched.h +++ b/include/nuttx/sched.h @@ -237,7 +237,7 @@ */ #ifdef CONFIG_SMP -# define this_cpu() up_cpu_index() +# define this_cpu() up_this_cpu() #else # define this_cpu() (0) #endif