Fix the context array size for MPU ports (#1230)

Fix the context array size for MPU ports

Ensure the saved context location falls within the reserved context area
rather than overlapping with the next MPU_SETTINGS structure member.

This never caused a problem because actual read/write operations
start from one word before the saved context location.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Gaurav-Aggarwal-AWS 2025-01-25 13:34:03 +05:30 committed by GitHub
parent 2b35979a1a
commit 11d0caa614
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 208 additions and 173 deletions

View file

@ -218,7 +218,16 @@ typedef struct MPU_REGION_SETTINGS
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
#define MAX_CONTEXT_SIZE ( 52 )
/*
* +---------+---------------+-----------------+-----------------+-----+
* | s16-s31 | s0-s15, FPSCR | CONTROL, r4-r11 | PSP, r0-r3, r12 | |
* | | | EXC_RETURN | LR, PC, xPSR | |
* +---------+---------------+-----------------+-----------------+-----+
*
* <--------><---------------><----------------><----------------><---->
* 16 17 10 9 1
*/
#define MAX_CONTEXT_SIZE ( 53 )
/* Size of an Access Control List (ACL) entry in bits. */
#define portACL_ENTRY_SIZE_BITS ( 32U )