scripts: gen_priv_stacks.py: use the right alignment for priv stacks

The privilege stacks are not sandboxed inside an MPU region,
so they do not have to be aligned with the stack buffer size.
We fix this by using the PRIVILEGE_STACK_ALIGN macro, which
is defined in arch.h and reflects the minimum alignment
requirement for privilege stack buffers.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2019-06-13 18:11:58 +02:00 committed by Andrew Boie
commit 88959e75dd

View file

@ -39,8 +39,10 @@ header = """%compare-lengths
"""
# Each privilege stack buffer needs to respect the alignment
# constraints as specified in arm/arch.h.
priv_stack_decl_temp = ("static u8_t __used"
" __aligned(CONFIG_PRIVILEGED_STACK_SIZE)"
" __aligned(Z_PRIVILEGE_STACK_ALIGN)"
" priv_stack_%x[CONFIG_PRIVILEGED_STACK_SIZE];\n")