zephyr/include
Andy Gross ecb0f3e159 arm: mpu: Account for stack guard size correctly
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>
2017-08-31 11:20:26 -05:00
..
arch arm: mpu: Account for stack guard size correctly 2017-08-31 11:20:26 -05:00
bluetooth Bluetooth: controller: Add LE Read Chan Map command 2017-08-25 11:27:22 +02:00
crypto crypto: Remove useless attribute 2017-04-27 13:06:31 +00:00
debug object_tracing: fix definition 2017-08-16 10:59:10 -07:00
display doc: spelling check doxygen comments include/ 2017-05-02 22:21:37 -04:00
drivers pwm: Remove k64-specific driver and k20_sim.h 2017-08-09 18:13:29 -04:00
dt-bindings i2c: Cleanup dts clock-frequency property usage 2017-08-16 10:03:34 -05:00
fs license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
linker arm: armv6-m: Support relocating vector table 2017-08-09 18:13:29 -04:00
logging doc: spelling check doxygen comments include/ 2017-05-02 22:21:37 -04:00
misc misc/byteorder: add support for __bswap_64 2017-08-09 10:55:53 +03:00
net net: app: Allow TLS and DTLS to be enabled separately 2017-08-30 08:12:10 -04:00
shell shell: Add define to _SHELL_H_ 2017-06-09 18:54:27 -04:00
toolchain xcc: fix __in_section_unique() and __COUNTER__ 2017-08-16 10:59:10 -07:00
usb doc: spelling check doxygen comments include/ 2017-05-02 22:21:37 -04:00
zephyr Introduce new sized integer typedefs 2017-04-20 16:07:08 +00:00
adc.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
aio_comparator.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
atomic.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
cache.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
clock_control.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
console.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
counter.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
crc16.h drivers: crc: Add 'pad' parameter to crc16() 2017-08-17 22:19:19 -04:00
device.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
disk_access.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
dma.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
eth.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
flash.h Introduce new sized integer typedefs 2017-04-20 16:07:08 +00:00
fs.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
gpio.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
i2c.h i2c: Add define for bit position/shift of I2C SPEED settings in config 2017-08-16 10:03:34 -05:00
i2s.h drivers: Add I2S (Inter-IC Sound) driver API 2017-08-14 11:14:34 -04:00
init.h kernel: remove deprecated init levels 2017-04-07 17:45:34 +00:00
ipm.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
irq_offload.h license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
irq.h irq.h: include generic toolchain header 2017-08-16 10:59:10 -07:00
kernel_version.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
kernel.h poll: Enable multiple threads to use k_poll in the same object 2017-08-25 09:00:46 -04:00
pinmux.h pinmux: Allow up to 6 functions 2017-08-09 12:26:14 -07:00
power.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
pthread.h kernel: POSIX thread IPC support 2017-08-15 19:42:07 -04:00
pwm.h drivers: pwm: Remove all deprecated APIs. 2017-08-09 12:31:03 -07:00
random.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
rtc.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sensor.h include: Add new sensor channel blue 2017-08-03 15:29:35 -05:00
shared_irq.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
spi_legacy.h api: New SPI API 2017-05-19 18:52:25 -04:00
spi.h doc: fix misspellings in include (API docs) 2017-08-10 12:22:19 -04:00
sw_isr_table.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
sys_clock.h kernel: tickless: Add tickless kernel support 2017-04-27 13:46:28 +00:00
sys_io.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
toolchain.h xtensa: move byte-order macros out of arch.h 2017-05-11 12:47:23 -04:00
uart.h drivers: serial: Clarification for uart_fifo_fill()/read() calls 2017-05-30 20:53:13 -04:00
watchdog.h Convert remaining code to using newly introduced integer sized types 2017-04-21 11:38:23 -05:00
zephyr.h kernel: remove legacy.h and MDEF support 2017-04-19 10:59:35 -05:00