mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Code review suggestions
Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
parent
ed6ec5c73f
commit
744d657c09
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -288,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -305,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -398,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -411,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -419,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -427,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -488,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -504,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -513,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -527,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -539,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -554,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -576,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -230,7 +230,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
#if ( portARMV8M_MINOR_VERSION >= 1 )
|
||||||
|
|
||||||
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
/* Enable Privileged eXecute Never MPU attribute for the selected memory
|
||||||
* region. */
|
* region. */
|
||||||
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
#define portMPU_RLAR_PRIVILEGED_EXECUTE_NEVER ( 1UL << 4UL )
|
||||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||||
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
||||||
/* Enable MPU. */
|
/* Enable MPU. */
|
||||||
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
#define portMPU_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
|
||||||
/* Expected value of the portMPU_TYPE register. */
|
|
||||||
#define portEXPECTED_MPU_TYPE_VALUE ( configTOTAL_MPU_REGIONS << 8UL )
|
|
||||||
|
|
||||||
/* Extract first address of the MPU region as encoded in the
|
/* Extract first address of the MPU region as encoded in the
|
||||||
* RBAR (Region Base Address Register) value. */
|
* RBAR (Region Base Address Register) value. */
|
||||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||||
|
@ -291,7 +288,7 @@ typedef void ( * portISR_t )( void );
|
||||||
|
|
||||||
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
#if ( configRUN_FREERTOS_SECURE_ONLY == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF FD
|
* FF FF FF FD
|
||||||
|
@ -308,7 +305,7 @@ typedef void ( * portISR_t )( void );
|
||||||
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
#define portINITIAL_EXC_RETURN ( 0xfffffffd )
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initial EXC_RETURN value.
|
* @brief Initial EXC_RETURN value.
|
||||||
*
|
*
|
||||||
* FF FF FF BC
|
* FF FF FF BC
|
||||||
|
@ -401,7 +398,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Extract MPU region's access permissions from the Region Base Address
|
* @brief Extract MPU region's access permissions from the Region Base Address
|
||||||
* Register (RBAR) value.
|
* Register (RBAR) value.
|
||||||
*
|
*
|
||||||
|
@ -414,7 +411,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Memory Protection Unit (MPU).
|
* @brief Setup the Memory Protection Unit (MPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -422,7 +419,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( configENABLE_FPU == 1 )
|
#if ( configENABLE_FPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Setup the Floating Point Unit (FPU).
|
* @brief Setup the Floating Point Unit (FPU).
|
||||||
*/
|
*/
|
||||||
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
static void prvSetupFPU( void ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -430,7 +427,7 @@ static void prvTaskExitError( void );
|
||||||
|
|
||||||
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
#if ( ( configENABLE_PAC == 1 ) || ( configENABLE_BTI == 1 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configures PACBTI features.
|
* @brief Configures PACBTI features.
|
||||||
*
|
*
|
||||||
* This function configures the Pointer Authentication, and Branch Target
|
* This function configures the Pointer Authentication, and Branch Target
|
||||||
|
@ -491,7 +488,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the system call stack so that upon returning from
|
* @brief Sets up the system call stack so that upon returning from
|
||||||
* SVC, the system call stack is used.
|
* SVC, the system call stack is used.
|
||||||
*
|
*
|
||||||
|
@ -507,7 +504,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Raise SVC for exiting from a system call.
|
* @brief Raise SVC for exiting from a system call.
|
||||||
*/
|
*/
|
||||||
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
void vRequestSystemCallExit( void ) __attribute__( ( naked ) ) PRIVILEGED_FUNCTION;
|
||||||
|
@ -516,7 +513,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Sets up the task stack so that upon returning from
|
* @brief Sets up the task stack so that upon returning from
|
||||||
* SVC, the task stack is used again.
|
* SVC, the task stack is used again.
|
||||||
*
|
*
|
||||||
|
@ -530,7 +527,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks whether or not the calling task is privileged.
|
* @brief Checks whether or not the calling task is privileged.
|
||||||
*
|
*
|
||||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||||
|
@ -542,7 +539,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
|
|
||||||
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
#if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This variable is set to pdTRUE when the scheduler is started.
|
* @brief This variable is set to pdTRUE when the scheduler is started.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
PRIVILEGED_DATA static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
@ -557,7 +554,7 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
|
@ -579,18 +576,18 @@ PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
||||||
/* The only permitted number of regions are 8 or 16. */
|
/* The only permitted number of regions are 8 or 16. */
|
||||||
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
configASSERT( ( configTOTAL_MPU_REGIONS == 8 ) || ( configTOTAL_MPU_REGIONS == 16 ) );
|
||||||
|
|
||||||
/* Ensure that the configTOTAL_MPU_REGIONS is configured correctly. */
|
|
||||||
configASSERT( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE );
|
|
||||||
|
|
||||||
/* Check that the MPU is present. */
|
|
||||||
if( portMPU_TYPE_REG == portEXPECTED_MPU_TYPE_VALUE )
|
|
||||||
{
|
|
||||||
/* MAIR0 - Index 0. */
|
/* MAIR0 - Index 0. */
|
||||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
/* MAIR0 - Index 1. */
|
/* MAIR0 - Index 1. */
|
||||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
||||||
* regions have privileged access. */
|
* regions have privileged access. */
|
||||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue