Skip to content

Commit 11d0caa

Browse files
authored
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>
1 parent 2b35979 commit 11d0caa

File tree

26 files changed

+208
-173
lines changed

26 files changed

+208
-173
lines changed

.github/workflows/kernel-demos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ jobs:
268268
fetch-depth: 1
269269

270270
- env:
271-
stepName: Fetch Community-Supported-Demos Submodule
271+
stepName: Fetch Dependencies
272272
shell: bash
273273
run: |
274274
# ${{ env.stepName }}
275275
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
276-
git submodule update --checkout --init --depth 1 FreeRTOS/Demo/ThirdParty/Community-Supported-Demos
276+
git submodule update --checkout --init --depth 1 FreeRTOS/Demo/ThirdParty/Community-Supported-Demos FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace
277277
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
278278
279279
# Checkout user pull request changes

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)