FreeRTOS-Kernel/portable/GCC/ARM_CM35P/non_secure
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
..
mpu_wrappers_v2_asm.c Fix AutoReload variable name (#1166) 2024-10-31 21:33:25 +05:30
port.c Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00
portasm.c Fix vPortFreeSecureContext to read xSecureContext at correct offset (#1441) 2026-07-01 10:58:41 -07:00
portasm.h Fix spelling typos (#1168) 2024-11-01 10:09:49 -07:00
portmacro.h Add Multicore SMP on Armv8-M ports (#1385) 2026-04-03 00:10:12 +00:00
portmacrocommon.h Fix MPU wrapper macro mapping for ARMv8M ports (#1419) 2026-05-29 20:08:02 -07:00