FreeRTOS-Kernel/portable/IAR
Gaurav-Aggarwal-AWS ae46383c90
Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441)
When MPU is enabled, the first item in the TCB is not the top of the
stack but the stored context location. As a result, xSecureContext
is located at a negative offset from that position rather than at
offset 0. The current implementation unconditionally reads
xSecureContext at offset 0, which returns an incorrect value when MPU
is enabled.

This commit updates vPortFreeSecureContext to read xSecureContext at
the correcct offset based on the port configuration:
- CM33/CM35P/CM52/CM55/CM85/STAR_MC3: -20 (or -36 with PAC enabled)
- CM23: -20 (no PAC support)
- Without MPU: 0 (xSecureContext remains at the top of stack)

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2026-07-01 10:58:41 -07:00
..
78K0R Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
ARM_CA5_No_GIC Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
ARM_CA9 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
ARM_CM0 Update broken links in readme and comments (#1110) 2024-08-05 16:00:47 +05:30
ARM_CM3 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
ARM_CM4F Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
ARM_CM4F_MPU Disallow unprivileged critical sections with MPU wrappers v2 (#1427) 2026-06-15 15:30:25 -07:00
ARM_CM7 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
ARM_CM23 Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
ARM_CM23_NTZ/non_secure Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
ARM_CM33 Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
ARM_CM33_NTZ/non_secure Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
ARM_CM35P Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
ARM_CM35P_NTZ/non_secure Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
ARM_CM52 Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
ARM_CM52_NTZ/non_secure Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
ARM_CM55 Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
ARM_CM55_NTZ/non_secure Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
ARM_CM85 Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
ARM_CM85_NTZ/non_secure Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
ARM_CRx_No_GIC fix typos in comments: interace -> interface, swtich -> switch (#1022) 2024-04-08 17:50:55 -07:00
ARM_STAR_MC3 Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
ARM_STAR_MC3_NTZ/non_secure Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
ATMega323 Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
AtmelSAM7S64 Fix spelling typos (#1168) 2024-11-01 10:09:49 -07:00
AtmelSAM9XE Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
AVR32_UC3 Fix spelling typos (#1168) 2024-11-01 10:09:49 -07:00
AVR_AVRDx Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
AVR_Mega0 Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
LPC2000 Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
MSP430 Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
MSP430X Remove hardware dependence in portmacros.h (#1112) 2024-08-19 11:31:30 +05:30
RISC-V Cleanup: remove unnecessary const variable (#1399) 2026-04-15 16:45:01 +00:00
RL78 fix[RL78 Port] incorrect register image for pvParameters in FAR model (#1316) (#1317) 2025-10-06 18:37:11 +05:30
RX100 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
RX600 Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
RX700v3_DPFPU Move configASSERT default definition above before including portable.h. (#1185) 2024-11-04 16:35:52 +05:30
RXv2 Add CFI frame unwind info in portable/IAR/RXv2/port_asm.s (#1341) 2026-01-12 17:53:32 +05:30
STR71x Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
STR75x Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
STR91x Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00
V850ES Use Regex for Copyright Year in Header Check (#1002) 2024-02-26 09:26:42 -08:00