ecb0f3e159
This patch fixes a couple of issues with the stack guard size and properly constructs the STACK_ALIGN and STACK_ALIGN_SIZE definitions. The ARM AAPCS requires that the stack pointers be 8 byte aligned. The STACK_ALIGN_SIZE definition is meant to contain the stack pointer alignment requirements. This is the required alignment at public API boundaries (ie stack frames). The STACK_ALIGN definition is the required alignment for the start address for stack buffer storage. STACK_ALIGN is used to validate the allocation sizes for stack buffers. The MPU_GUARD_ALIGN_AND_SIZE definition is the minimum alignment and size for the MPU. The minimum size and alignment just so happen to be 32 bytes for vanilla ARM MPU implementations. When defining stack buffers, the stack guard alignment requirements must be taken into consideration when allocating the stack memory. The __align() must be filled in with either STACK_ALIGN_SIZE or the align/size of the MPU stack guard. The align/size for the guard region will be 0 when CONFIG_MPU_STACK_GUARD is not set, and 32 bytes when it is. The _ARCH_THREAD_STACK_XXXXXX APIs need to know the minimum alignment requirements for the stack buffer memory and the stack guard size to correctly allocate and reference the stack memory. This is reflected in the macros with the use of the STACK_ALIGN definition and the MPU_GUARD_ALIGN_AND_SIZE definition. Signed-off-by: Andy Gross <andy.gross@linaro.org> |
||
---|---|---|
.. | ||
mpu | ||
Kconfig | ||
Makefile | ||
exc_manage.c | ||
nmi.c | ||
nmi_on_reset.S | ||
prep_c.c | ||
reset.S | ||
scb.c | ||
vector_table.S | ||
vector_table.h |