From a0991dfffabaece422c34001a6fc41f2383d3a39 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Thu, 10 Nov 2022 13:40:40 +0100 Subject: [PATCH] freertos-smp: Enabled static task cleanup for RISC-V targets with FreeRTOS SMP This commit enables static task clean up for RISC-V targets with FreeRTOS SMP. --- .../FreeRTOS-Kernel-SMP/portable/riscv/port.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/port.c b/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/port.c index f99f405342..4391b8a94a 100644 --- a/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/port.c +++ b/components/freertos/FreeRTOS-Kernel-SMP/portable/riscv/port.c @@ -814,8 +814,19 @@ void vApplicationMinimalIdleHook( void ) * Hook function called during prvDeleteTCB() to cleanup any * 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 ) +#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 ) /* Call TLS pointers deletion callbacks */ vPortTLSPointersDelCb( pxTCB );