Merge branch 'feature/freertos_smp_enable_static_task_cleanup' into 'master'

freertos-smp: Enable static task cleanup

See merge request espressif/esp-idf!20870
This commit is contained in:
Zim Kalinowski
2022-11-04 19:18:03 +08:00
4 changed files with 17 additions and 4 deletions

View File

@@ -149,4 +149,8 @@ else()
if(CONFIG_SPIRAM) if(CONFIG_SPIRAM)
idf_component_optional_requires(PRIVATE esp_psram) idf_component_optional_requires(PRIVATE esp_psram)
endif() endif()
if(CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP AND CONFIG_FREERTOS_SMP)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=vPortCleanUpTCB")
endif()
endif() endif()

View File

@@ -1004,8 +1004,19 @@ void vApplicationMinimalIdleHook( void )
* Hook function called during prvDeleteTCB() to cleanup any * Hook function called during prvDeleteTCB() to cleanup any
* user defined static memory areas in the TCB. * user defined static memory areas in the TCB.
*/ */
#if CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP
void __real_vPortCleanUpTCB( void *pxTCB );
void __wrap_vPortCleanUpTCB( void *pxTCB )
#else
void vPortCleanUpTCB ( void *pxTCB ) void vPortCleanUpTCB ( void *pxTCB )
#endif /* CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP */
{ {
#if ( CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP )
/* Call user defined vPortCleanUpTCB */
__real_vPortCleanUpTCB( pxTCB );
#endif /* CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP */
#if ( CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS ) #if ( CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS )
/* Call TLS pointers deletion callbacks */ /* Call TLS pointers deletion callbacks */
vPortTLSPointersDelCb( pxTCB ); vPortTLSPointersDelCb( pxTCB );

View File

@@ -303,8 +303,6 @@ menu "FreeRTOS"
off to save space in the TCB memory. off to save space in the TCB memory.
config FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP config FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP
# Todo: This is incompatible with SMP FreeRTOS. See if this can be deprecated (IDF-4986)
depends on !FREERTOS_SMP
bool "Enable static task clean up hook" bool "Enable static task clean up hook"
default n default n
help help

View File

@@ -6,7 +6,6 @@
#include "sdkconfig.h" #include "sdkconfig.h"
#ifndef CONFIG_FREERTOS_SMP
/* /*
Note: We disable this test when using the FreeRTOS SMP kernel as the port will already provide Note: We disable this test when using the FreeRTOS SMP kernel as the port will already provide
a definition for vApplicationTickHook(). Thus this test cannot be run. a definition for vApplicationTickHook(). Thus this test cannot be run.
@@ -19,6 +18,7 @@ a definition for vApplicationTickHook(). Thus this test cannot be run.
#include "unity.h" #include "unity.h"
#include "test_utils.h" #include "test_utils.h"
#ifndef CONFIG_FREERTOS_SMP
/* /*
Test FreeRTOS idle hook. Only compiled in if FreeRTOS idle hooks are enabled. Test FreeRTOS idle hook. Only compiled in if FreeRTOS idle hooks are enabled.
*/ */
@@ -63,6 +63,7 @@ TEST_CASE("FreeRTOS tick hook", "[freertos]")
} }
#endif // configUSE_TICK_HOOK #endif // configUSE_TICK_HOOK
#endif // CONFIG_FREERTOS_SMP
#if CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP #if CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP
@@ -91,4 +92,3 @@ TEST_CASE("static task cleanup hook is called based on config", "[freertos]")
} }
#endif // CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP #endif // CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP
#endif // CONFIG_FREERTOS_SMP