Update MPU wrapper for xTimerGenericCommand API (#734)

* Update xTimerGenericCommand API as per SMP branch

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>

* Fix formatting

* Code review changes

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

* Fix Formatting

---------

Signed-off-by: kar-rahul-aws <karahulx@amazon.com>
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
kar-rahul-aws 2023-08-01 20:12:58 +05:30 committed by GitHub
parent 0066c28cb2
commit b51a37314c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 693 additions and 799 deletions

View file

@ -1943,11 +1943,11 @@
/*-----------------------------------------------------------*/
#if ( configUSE_TIMERS == 1 )
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* FREERTOS_SYSTEM_CALL */
BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* FREERTOS_SYSTEM_CALL */
{
BaseType_t xReturn;
@ -1956,7 +1956,7 @@
portRAISE_PRIVILEGE();
portMEMORY_BARRIER();
xReturn = xTimerGenericCommand( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
xReturn = xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
portMEMORY_BARRIER();
portRESET_PRIVILEGE();
@ -1964,7 +1964,7 @@
}
else
{
xReturn = xTimerGenericCommand( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
xReturn = xTimerGenericCommandFromTask( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
}
return xReturn;

View file

@ -2917,17 +2917,17 @@
#if ( configUSE_TIMERS == 1 )
BaseType_t MPU_xTimerGenericCommandImpl( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
BaseType_t MPU_xTimerGenericCommandFromTaskImpl( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
BaseType_t MPU_xTimerGenericCommandImpl( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* PRIVILEGED_FUNCTION */
BaseType_t MPU_xTimerGenericCommandFromTaskImpl( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* PRIVILEGED_FUNCTION */
{
BaseType_t xReturn = pdFALSE;
TimerHandle_t xInternalTimerHandle = NULL;
@ -2951,7 +2951,7 @@
if( xInternalTimerHandle != NULL )
{
xReturn = xTimerGenericCommand( xInternalTimerHandle, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
xReturn = xTimerGenericCommandFromTask( xInternalTimerHandle, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
}
}
}
@ -3232,6 +3232,47 @@
#endif /* if ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_TIMERS == 1 ) */
/*-----------------------------------------------------------*/
#if ( configUSE_TIMERS == 1 )
BaseType_t MPU_xTimerGenericCommandFromISR( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* PRIVILEGED_FUNCTION */
{
BaseType_t xReturn = pdFALSE;
TimerHandle_t xInternalTimerHandle = NULL;
int32_t lIndex;
BaseType_t xIsHigherPriorityTaskWokenWriteable = pdFALSE;
if( pxHigherPriorityTaskWoken != NULL )
{
xIsHigherPriorityTaskWokenWriteable = xPortIsAuthorizedToAccessBuffer( pxHigherPriorityTaskWoken,
sizeof( BaseType_t ),
tskMPU_WRITE_PERMISSION );
}
if( ( pxHigherPriorityTaskWoken == NULL ) || ( xIsHigherPriorityTaskWokenWriteable == pdTRUE ) )
{
lIndex = ( int32_t ) xTimer;
if( IS_EXTERNAL_INDEX_VALID( lIndex ) != pdFALSE )
{
xInternalTimerHandle = MPU_GetTimerHandleAtIndex( CONVERT_TO_INTERNAL_INDEX( lIndex ) );
if( xInternalTimerHandle != NULL )
{
xReturn = xTimerGenericCommandFromISR( xInternalTimerHandle, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
}
}
}
return xReturn;
}
#endif /* if ( configUSE_TIMERS == 1 ) */
/*-----------------------------------------------------------*/
/*-----------------------------------------------------------*/
/* MPU wrappers for event group APIs. */
/*-----------------------------------------------------------*/