Skip to content
Permalink
Browse files

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>
  • Loading branch information...
ioannisg authored and andrewboie committed Jun 13, 2019
1 parent 723aae9 commit 88959e75dd1b26918b05c1c238dd806d952c603b
Showing with 3 additions and 1 deletion.
  1. +3 −1 scripts/gen_priv_stacks.py
@@ -39,8 +39,10 @@
"""


# 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")


0 comments on commit 88959e7

Please sign in to comment.
You can’t perform that action at this time.