Skip to content

Commit

Permalink
scripts: gen_priv_stacks.py: use the right alignment for priv stacks
Browse files Browse the repository at this point in the history
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 24, 2019
1 parent 723aae9 commit 88959e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/gen_priv_stacks.py
Expand Up @@ -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" 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") " priv_stack_%x[CONFIG_PRIVILEGED_STACK_SIZE];\n")




Expand Down

0 comments on commit 88959e7

Please sign in to comment.