mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
FreeRTOS MPU: allow user control on CM55 devices with 16 MPU regions
Remove the assertion that forces the application to match configTOTAL_MPU_REGIONS with the number of regions present in the hardware. This allows applications running on devices with 16 MPU regions to control the second half, while the kernel retains control of the first. Signed-off-by: Erick Reyes <erickreyes@google.com>
This commit is contained in:
parent
dacce186cf
commit
ed6ec5c73f
|
@ -241,9 +241,6 @@ typedef void ( * portISR_t )( void );
|
|||
/* Enable MPU. */
|
||||
#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
|
||||
* RBAR (Region Base Address Register) value. */
|
||||
#define portEXTRACT_FIRST_ADDRESS_FROM_RBAR( rbar ) \
|
||||
|
@ -925,12 +922,6 @@ static void prvTaskExitError( void )
|
|||
/* The only permitted number of regions are 8 or 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. */
|
||||
portMPU_MAIR0_REG |= ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||
/* MAIR0 - Index 1. */
|
||||
|
@ -983,7 +974,6 @@ static void prvTaskExitError( void )
|
|||
* regions have privileged access. */
|
||||
portMPU_CTRL_REG |= ( portMPU_PRIV_BACKGROUND_ENABLE_BIT | portMPU_ENABLE_BIT );
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* configENABLE_MPU */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Reference in a new issue