Skip to content

Commit 1c2f214

Browse files
committed
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>
1 parent 72bb476 commit 1c2f214

File tree

25 files changed

+206
-171
lines changed

25 files changed

+206
-171
lines changed

portable/ARMv8M/non_secure/portmacrocommon.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
251251
* +-----------+---------------+----------+-----------------+------------------------------+------------+-----+
252252
*
253253
* <-----------><--------------><---------><----------------><-----------------------------><-----------><---->
254-
* 16 16 8 8 5 16 1
254+
* 16 17 8 8 5 16 1
255255
*/
256-
#define MAX_CONTEXT_SIZE 70
256+
#define MAX_CONTEXT_SIZE 71
257257

258258
#elif ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 0 ) )
259259

@@ -264,9 +264,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
264264
* +-----------+---------------+----------+-----------------+------------------------------+-----+
265265
*
266266
* <-----------><--------------><---------><----------------><-----------------------------><---->
267-
* 16 16 8 8 5 1
267+
* 16 17 8 8 5 1
268268
*/
269-
#define MAX_CONTEXT_SIZE 54
269+
#define MAX_CONTEXT_SIZE 55
270270

271271
#elif ( ( configENABLE_TRUSTZONE == 0 ) && ( configENABLE_PAC == 1 ) )
272272

@@ -277,9 +277,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
277277
* +-----------+---------------+----------+-----------------+----------------------+------------+-----+
278278
*
279279
* <-----------><--------------><---------><----------------><---------------------><-----------><---->
280-
* 16 16 8 8 4 16 1
280+
* 16 17 8 8 4 16 1
281281
*/
282-
#define MAX_CONTEXT_SIZE 69
282+
#define MAX_CONTEXT_SIZE 70
283283

284284
#else /* if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
285285

@@ -290,9 +290,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
290290
* +-----------+---------------+----------+-----------------+----------------------+-----+
291291
*
292292
* <-----------><--------------><---------><----------------><---------------------><---->
293-
* 16 16 8 8 4 1
293+
* 16 17 8 8 4 1
294294
*/
295-
#define MAX_CONTEXT_SIZE 53
295+
#define MAX_CONTEXT_SIZE 54
296296

297297
#endif /* #if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
298298

portable/GCC/ARM_CM23/non_secure/portmacrocommon.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
251251
* +-----------+---------------+----------+-----------------+------------------------------+------------+-----+
252252
*
253253
* <-----------><--------------><---------><----------------><-----------------------------><-----------><---->
254-
* 16 16 8 8 5 16 1
254+
* 16 17 8 8 5 16 1
255255
*/
256-
#define MAX_CONTEXT_SIZE 70
256+
#define MAX_CONTEXT_SIZE 71
257257

258258
#elif ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 0 ) )
259259

@@ -264,9 +264,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
264264
* +-----------+---------------+----------+-----------------+------------------------------+-----+
265265
*
266266
* <-----------><--------------><---------><----------------><-----------------------------><---->
267-
* 16 16 8 8 5 1
267+
* 16 17 8 8 5 1
268268
*/
269-
#define MAX_CONTEXT_SIZE 54
269+
#define MAX_CONTEXT_SIZE 55
270270

271271
#elif ( ( configENABLE_TRUSTZONE == 0 ) && ( configENABLE_PAC == 1 ) )
272272

@@ -277,9 +277,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
277277
* +-----------+---------------+----------+-----------------+----------------------+------------+-----+
278278
*
279279
* <-----------><--------------><---------><----------------><---------------------><-----------><---->
280-
* 16 16 8 8 4 16 1
280+
* 16 17 8 8 4 16 1
281281
*/
282-
#define MAX_CONTEXT_SIZE 69
282+
#define MAX_CONTEXT_SIZE 70
283283

284284
#else /* if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
285285

@@ -290,9 +290,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
290290
* +-----------+---------------+----------+-----------------+----------------------+-----+
291291
*
292292
* <-----------><--------------><---------><----------------><---------------------><---->
293-
* 16 16 8 8 4 1
293+
* 16 17 8 8 4 1
294294
*/
295-
#define MAX_CONTEXT_SIZE 53
295+
#define MAX_CONTEXT_SIZE 54
296296

297297
#endif /* #if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
298298

portable/GCC/ARM_CM23_NTZ/non_secure/portmacrocommon.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
251251
* +-----------+---------------+----------+-----------------+------------------------------+------------+-----+
252252
*
253253
* <-----------><--------------><---------><----------------><-----------------------------><-----------><---->
254-
* 16 16 8 8 5 16 1
254+
* 16 17 8 8 5 16 1
255255
*/
256-
#define MAX_CONTEXT_SIZE 70
256+
#define MAX_CONTEXT_SIZE 71
257257

258258
#elif ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 0 ) )
259259

@@ -264,9 +264,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
264264
* +-----------+---------------+----------+-----------------+------------------------------+-----+
265265
*
266266
* <-----------><--------------><---------><----------------><-----------------------------><---->
267-
* 16 16 8 8 5 1
267+
* 16 17 8 8 5 1
268268
*/
269-
#define MAX_CONTEXT_SIZE 54
269+
#define MAX_CONTEXT_SIZE 55
270270

271271
#elif ( ( configENABLE_TRUSTZONE == 0 ) && ( configENABLE_PAC == 1 ) )
272272

@@ -277,9 +277,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
277277
* +-----------+---------------+----------+-----------------+----------------------+------------+-----+
278278
*
279279
* <-----------><--------------><---------><----------------><---------------------><-----------><---->
280-
* 16 16 8 8 4 16 1
280+
* 16 17 8 8 4 16 1
281281
*/
282-
#define MAX_CONTEXT_SIZE 69
282+
#define MAX_CONTEXT_SIZE 70
283283

284284
#else /* if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
285285

@@ -290,9 +290,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
290290
* +-----------+---------------+----------+-----------------+----------------------+-----+
291291
*
292292
* <-----------><--------------><---------><----------------><---------------------><---->
293-
* 16 16 8 8 4 1
293+
* 16 17 8 8 4 1
294294
*/
295-
#define MAX_CONTEXT_SIZE 53
295+
#define MAX_CONTEXT_SIZE 54
296296

297297
#endif /* #if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
298298

portable/GCC/ARM_CM33/non_secure/portmacrocommon.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
251251
* +-----------+---------------+----------+-----------------+------------------------------+------------+-----+
252252
*
253253
* <-----------><--------------><---------><----------------><-----------------------------><-----------><---->
254-
* 16 16 8 8 5 16 1
254+
* 16 17 8 8 5 16 1
255255
*/
256-
#define MAX_CONTEXT_SIZE 70
256+
#define MAX_CONTEXT_SIZE 71
257257

258258
#elif ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 0 ) )
259259

@@ -264,9 +264,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
264264
* +-----------+---------------+----------+-----------------+------------------------------+-----+
265265
*
266266
* <-----------><--------------><---------><----------------><-----------------------------><---->
267-
* 16 16 8 8 5 1
267+
* 16 17 8 8 5 1
268268
*/
269-
#define MAX_CONTEXT_SIZE 54
269+
#define MAX_CONTEXT_SIZE 55
270270

271271
#elif ( ( configENABLE_TRUSTZONE == 0 ) && ( configENABLE_PAC == 1 ) )
272272

@@ -277,9 +277,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
277277
* +-----------+---------------+----------+-----------------+----------------------+------------+-----+
278278
*
279279
* <-----------><--------------><---------><----------------><---------------------><-----------><---->
280-
* 16 16 8 8 4 16 1
280+
* 16 17 8 8 4 16 1
281281
*/
282-
#define MAX_CONTEXT_SIZE 69
282+
#define MAX_CONTEXT_SIZE 70
283283

284284
#else /* if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
285285

@@ -290,9 +290,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
290290
* +-----------+---------------+----------+-----------------+----------------------+-----+
291291
*
292292
* <-----------><--------------><---------><----------------><---------------------><---->
293-
* 16 16 8 8 4 1
293+
* 16 17 8 8 4 1
294294
*/
295-
#define MAX_CONTEXT_SIZE 53
295+
#define MAX_CONTEXT_SIZE 54
296296

297297
#endif /* #if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
298298

portable/GCC/ARM_CM33_NTZ/non_secure/portmacrocommon.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
251251
* +-----------+---------------+----------+-----------------+------------------------------+------------+-----+
252252
*
253253
* <-----------><--------------><---------><----------------><-----------------------------><-----------><---->
254-
* 16 16 8 8 5 16 1
254+
* 16 17 8 8 5 16 1
255255
*/
256-
#define MAX_CONTEXT_SIZE 70
256+
#define MAX_CONTEXT_SIZE 71
257257

258258
#elif ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 0 ) )
259259

@@ -264,9 +264,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
264264
* +-----------+---------------+----------+-----------------+------------------------------+-----+
265265
*
266266
* <-----------><--------------><---------><----------------><-----------------------------><---->
267-
* 16 16 8 8 5 1
267+
* 16 17 8 8 5 1
268268
*/
269-
#define MAX_CONTEXT_SIZE 54
269+
#define MAX_CONTEXT_SIZE 55
270270

271271
#elif ( ( configENABLE_TRUSTZONE == 0 ) && ( configENABLE_PAC == 1 ) )
272272

@@ -277,9 +277,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
277277
* +-----------+---------------+----------+-----------------+----------------------+------------+-----+
278278
*
279279
* <-----------><--------------><---------><----------------><---------------------><-----------><---->
280-
* 16 16 8 8 4 16 1
280+
* 16 17 8 8 4 16 1
281281
*/
282-
#define MAX_CONTEXT_SIZE 69
282+
#define MAX_CONTEXT_SIZE 70
283283

284284
#else /* if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
285285

@@ -290,9 +290,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
290290
* +-----------+---------------+----------+-----------------+----------------------+-----+
291291
*
292292
* <-----------><--------------><---------><----------------><---------------------><---->
293-
* 16 16 8 8 4 1
293+
* 16 17 8 8 4 1
294294
*/
295-
#define MAX_CONTEXT_SIZE 53
295+
#define MAX_CONTEXT_SIZE 54
296296

297297
#endif /* #if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
298298

portable/GCC/ARM_CM35P/non_secure/portmacrocommon.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
251251
* +-----------+---------------+----------+-----------------+------------------------------+------------+-----+
252252
*
253253
* <-----------><--------------><---------><----------------><-----------------------------><-----------><---->
254-
* 16 16 8 8 5 16 1
254+
* 16 17 8 8 5 16 1
255255
*/
256-
#define MAX_CONTEXT_SIZE 70
256+
#define MAX_CONTEXT_SIZE 71
257257

258258
#elif ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 0 ) )
259259

@@ -264,9 +264,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
264264
* +-----------+---------------+----------+-----------------+------------------------------+-----+
265265
*
266266
* <-----------><--------------><---------><----------------><-----------------------------><---->
267-
* 16 16 8 8 5 1
267+
* 16 17 8 8 5 1
268268
*/
269-
#define MAX_CONTEXT_SIZE 54
269+
#define MAX_CONTEXT_SIZE 55
270270

271271
#elif ( ( configENABLE_TRUSTZONE == 0 ) && ( configENABLE_PAC == 1 ) )
272272

@@ -277,9 +277,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
277277
* +-----------+---------------+----------+-----------------+----------------------+------------+-----+
278278
*
279279
* <-----------><--------------><---------><----------------><---------------------><-----------><---->
280-
* 16 16 8 8 4 16 1
280+
* 16 17 8 8 4 16 1
281281
*/
282-
#define MAX_CONTEXT_SIZE 69
282+
#define MAX_CONTEXT_SIZE 70
283283

284284
#else /* if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
285285

@@ -290,9 +290,9 @@ extern void vClearInterruptMask( uint32_t ulMask ) /* __attribute__(( naked )) P
290290
* +-----------+---------------+----------+-----------------+----------------------+-----+
291291
*
292292
* <-----------><--------------><---------><----------------><---------------------><---->
293-
* 16 16 8 8 4 1
293+
* 16 17 8 8 4 1
294294
*/
295-
#define MAX_CONTEXT_SIZE 53
295+
#define MAX_CONTEXT_SIZE 54
296296

297297
#endif /* #if ( ( configENABLE_TRUSTZONE == 1 ) && ( configENABLE_PAC == 1 ) ) */
298298

0 commit comments

Comments
 (0)