freertos(IDF): Provide default value to configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS

This commit updates how configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS is defined
by default it to 0 if not defined elsewhere. Dependent code now check for
"configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1" instead.
pull/10165/head
Darian Leung 2022-11-08 17:48:48 +08:00
rodzic fce4ee0b80
commit 915787249a
4 zmienionych plików z 18 dodań i 12 usunięć

Wyświetl plik

@ -228,6 +228,10 @@
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS 0
#endif
#ifndef configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS
#define configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS 0
#endif
#ifndef configUSE_RECURSIVE_MUTEXES
#define configUSE_RECURSIVE_MUTEXES 0
#endif
@ -1231,7 +1235,7 @@ typedef struct xSTATIC_TCB
#endif
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
void * pvDummy15[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
void * pvDummyLocalStorageCallBack[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
#endif
#endif

Wyświetl plik

@ -2024,7 +2024,7 @@ uint8_t * pxTaskGetStackStart( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
void * pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
BaseType_t xIndex ) PRIVILEGED_FUNCTION;
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
/**
* Prototype of local storage pointer deletion callback.

Wyświetl plik

@ -340,7 +340,7 @@ typedef struct tskTaskControlBlock /* The old naming convention is used to
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 )
void * pvThreadLocalStoragePointers[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
TlsDeleteCallbackFunction_t pvThreadLocalStoragePointersDelCallback[ configNUM_THREAD_LOCAL_STORAGE_POINTERS ];
#endif
#endif
@ -539,7 +539,7 @@ static portTASK_FUNCTION_PROTO( prvIdleTask, pvParameters ) PRIVILEGED_FUNCTION;
/* Function to call the Thread Local Storage Pointer Deletion Callbacks. Will be
* called during task deletion before prvDeleteTCB is called.
*/
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
static void prvDeleteTLS( TCB_t * pxTCB );
#endif
@ -1486,7 +1486,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
if( xFreeNow == pdTRUE )
{
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
prvDeleteTLS( pxTCB );
#endif
@ -4378,7 +4378,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
void vTaskSetThreadLocalStoragePointerAndDelCallback( TaskHandle_t xTaskToSet,
BaseType_t xIndex,
@ -4405,7 +4405,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
}
#else /* if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS ) */
#else /* if ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 ) */
void vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
BaseType_t xIndex,
void * pvValue )
@ -4420,7 +4420,7 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
taskEXIT_CRITICAL( &xKernelLock );
}
}
#endif /* configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS */
#endif /* configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 */
#endif /* configNUM_THREAD_LOCAL_STORAGE_POINTERS */
/*-----------------------------------------------------------*/
@ -4557,7 +4557,7 @@ static void prvCheckTasksWaitingTermination( void )
if( pxTCB != NULL ) /*Call deletion callbacks and free TCB memory */
{
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
prvDeleteTLS( pxTCB );
#endif
prvDeleteTCB( pxTCB );
@ -4892,7 +4892,7 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
#endif /* INCLUDE_vTaskDelete */
/*-----------------------------------------------------------*/
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS )
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 )
static void prvDeleteTLS( TCB_t * pxTCB )
{
@ -4907,7 +4907,7 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
}
}
#endif /* ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS ) */
#endif /* ( configNUM_THREAD_LOCAL_STORAGE_POINTERS > 0 ) && ( configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS == 1 ) */
/*-----------------------------------------------------------*/

Wyświetl plik

@ -266,7 +266,9 @@ Note: Include trace macros here and not above as trace macros are dependent on s
// ---------------------- Features -------------------------
#define configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS
#ifdef CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS
#define configTHREAD_LOCAL_STORAGE_DELETE_CALLBACKS 1
#endif
#if CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER
#define configCHECK_MUTEX_GIVEN_BY_OWNER 1