A stray IAR installer download URL was left outside the comment delimiters
in the restore_special_regs section of the IAR TrustZone non-secure ports.
The assembler parses the bare URL as an operand of the preceding ldmia, so
any build of these ports aborts with:
Error: garbage following instruction -- 'ldmia r2!,{r0,r3,lr} http:'
The line is outside the configENABLE_PAC conditional block, so it breaks
every configuration of the port, not only PAC-enabled builds.
Commit 78e0cc7 ("ARMv8.1-M: Add task dedicated PAC key support", #1195)
introduced the URL in the CM33/CM35P/CM55/CM85 and ARMv8M non-secure
ports. The CM52 (#1334) and STAR-MC3 (#1363) ports inherited it when
their portasm.s was created from an already-affected file.
The stray URL is removed rather than moved inside the comment, matching
the unaffected sibling port ARM_CM23/non_secure/portasm.s, which carries
the same comment text without any URL.
Verified with arm-none-eabi-gcc 13.3.1: all six files fail to assemble
before the change and assemble cleanly after it.
Relates to #1480. The ARM_CM33 non-secure port is handled separately by
#1485, so it is intentionally not touched here.
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>