feat(freertos): Introduced new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES

This commit replaces the use of portNUM_PROCESSORS and configNUM_CORES
macros in all of ESP-IDF. These macros are needed to realize an SMP
scenario by fetching the number of active cores FreeRTOS is running on.
Instead, a new Kconfig option, CONFIG_FREERTOS_NUMBER_OF_CORES, has been
added as a proxy for the FreeRTOS config option, configNUMBER_OF_CORES.
This new commit is now used to realize an SMP scenario in various places
in ESP-IDF.

[Sudeep Mohanty: Added new Kconfig option CONFIG_FREERTOS_NUMBER_OF_CORES]

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
This commit is contained in:
fl0wl0w
2023-12-13 16:32:53 -06:00
committed by Sudeep Mohanty
parent b8abf75a11
commit 90d1dcfd76
91 changed files with 361 additions and 307 deletions

View File

@@ -6,6 +6,7 @@
#include <vector>
#include <numeric>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
@@ -105,7 +106,7 @@ TEST_CASE("static initialization guards work as expected", "[misc]")
int task_count = 0;
// four tasks competing for static initialization of one object
task_count += start_slow_init_task<1>(0, PRO_CPU_NUM);
#if portNUM_PROCESSORS == 2
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2
task_count += start_slow_init_task<1>(1, APP_CPU_NUM);
#endif
task_count += start_slow_init_task<1>(2, PRO_CPU_NUM);
@@ -113,7 +114,7 @@ TEST_CASE("static initialization guards work as expected", "[misc]")
// four tasks competing for static initialization of another object
task_count += start_slow_init_task<2>(0, PRO_CPU_NUM);
#if portNUM_PROCESSORS == 2
#if CONFIG_FREERTOS_NUMBER_OF_CORES == 2
task_count += start_slow_init_task<2>(1, APP_CPU_NUM);
#endif
task_count += start_slow_init_task<2>(2, PRO_CPU_NUM);