Merge branch 'feature/freertos_enable_port_optimized_task_selection_on_riscv_targets' into 'master'

freertos: Enable configUSE_PORT_OPTIMISED_TASK_SELECTION for RISC-V targets

See merge request espressif/esp-idf!20652
This commit is contained in:
Sudeep Mohanty 2022-10-19 16:19:19 +08:00
commit 7a58ffa972
3 changed files with 19 additions and 3 deletions

View File

@ -17,7 +17,11 @@
// ------------------ Scheduler Related --------------------
#ifdef CONFIG_FREERTOS_OPTIMIZED_SCHEDULER
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#else
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
#endif
#define configMAX_API_CALL_INTERRUPT_PRIORITY 0
/* ------------------------------------------------ ESP-IDF Additions --------------------------------------------------

View File

@ -399,6 +399,19 @@ FORCE_INLINE_ATTR BaseType_t xPortGetCoreID(void)
#define portALT_GET_RUN_TIME_COUNTER_VALUE(x) do {x = (uint32_t)esp_timer_get_time();} while(0)
#endif
// -------------- Optimized Task Selection -----------------
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
/* Check the configuration. */
#if( configMAX_PRIORITIES > 32 )
#error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 different priorities as tasks that share a priority will time slice.
#endif
/* Store/clear the ready priorities in a bit map. */
#define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
#define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
#define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __builtin_clz( ( uxReadyPriorities ) ) )
#endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */
/* --------------------------------------------- Inline Implementations ------------------------------------------------

View File

@ -38,13 +38,12 @@ menu "FreeRTOS"
details).
config FREERTOS_OPTIMIZED_SCHEDULER
# Todo: Not available in SMP FREERTOS (IDF-4986)
# Todo: Rename to CONFIG_FREERTOS_USE_PORT_OPTIMISED_TASK_SELECTION (IDF-4986)
# Todo: Not available in SMP FREERTOS (IDF-3733)
bool "configUSE_PORT_OPTIMISED_TASK_SELECTION"
depends on FREERTOS_UNICORE
default y
help
Enables port specific task selection method. This option can will speed up the search of ready tasks
Enables port specific task selection method. This option can speed up the search of ready tasks
when scheduling (see configUSE_PORT_OPTIMISED_TASK_SELECTION documentation for more details).
choice FREERTOS_CHECK_STACKOVERFLOW