mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 01:37:22 +00:00
components/esp_common: added esp_macros.h that aims to hold useful macros
esp_common/esp_compiler: renamed esp_macros file to a more specific one esp_common/esp_compiler: removed CONTAINER_OF macro, it was a duplicate components/freertos: placed likely macros around port and critical sections component/freertos: placed likely macros on lists module components/freertos: placed unlikely macros inside of assertion points, they likely wont fail components/freertos: added likely macros on queue modules FreeRTOS queues are one of most hot code path, because to queues itself tend to be used a lot by the applications, besides that, queues are the basic primitive to form both mutexes and semaphores, The focus here is to place likely macros inside lowest level send and receive routines, since they're common from all kobjects: semaphores, queues, mutexes and FR internals (like timer queue) components/lwip: placed likely/unlikey on net-interfaces code components/fatfs: added unlikely macros on disk drivers code components/spiffs: added unlikely macros on low level fs driver components/freertos: added likely/unlikely macros on timers and ticker freertos/event_group: placed likely/unlikely macros on hot event group code paths components/sdmmc: placed likely / unlikely macros on lower level path of sdmmc components/bt: placed unlikely macros around bt HCI functions calling components/lwip: added likely/unlikely macros on OS port code section components/freertos: fix code style on tick handler
This commit is contained in:
@@ -782,7 +782,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
else if( xYieldRequired != pdFALSE )
|
||||
else if(unlikely(xYieldRequired != pdFALSE))
|
||||
{
|
||||
/* This path is a special case that will only get
|
||||
executed if the task was holding multiple mutexes
|
||||
@@ -815,7 +815,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
}
|
||||
else if( xYieldRequired != pdFALSE )
|
||||
else if(unlikely(xYieldRequired != pdFALSE))
|
||||
{
|
||||
/* This path is a special case that will only get
|
||||
executed if the task was holding multiple mutexes and
|
||||
@@ -868,7 +868,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
taskENTER_CRITICAL(&pxQueue->mux);
|
||||
|
||||
/* Update the timeout state to see if it has expired yet. */
|
||||
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
|
||||
if(likely(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE ))
|
||||
{
|
||||
if( prvIsQueueFull( pxQueue ) != pdFALSE )
|
||||
{
|
||||
@@ -1573,7 +1573,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
|
||||
taskENTER_CRITICAL(&pxQueue->mux);
|
||||
|
||||
/* Update the timeout state to see if it has expired yet. */
|
||||
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
|
||||
if(likely(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE))
|
||||
{
|
||||
if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
|
||||
{
|
||||
@@ -1888,7 +1888,7 @@ BaseType_t xReturn = pdFALSE;
|
||||
}
|
||||
#endif /* configUSE_MUTEXES */
|
||||
}
|
||||
else if( xPosition == queueSEND_TO_BACK )
|
||||
else if(likely(xPosition == queueSEND_TO_BACK))
|
||||
{
|
||||
( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. */
|
||||
pxQueue->pcWriteTo += pxQueue->uxItemSize;
|
||||
|
Reference in New Issue
Block a user