zephyr/arch/arm/core
Andrew Boie 507852a4ad kernel: introduce opaque data type for stacks
Historically, stacks were just character buffers and could be treated
as such if the user wanted to look inside the stack data, and also
declared as an array of the desired stack size.

This is no longer the case. Certain architectures will create a memory
region much larger to account for MPU/MMU guard pages. Unfortunately,
the kernel interfaces treat both the declared stack, and the valid
stack buffer within it as the same char * data type, even though these
absolutely cannot be used interchangeably.

We introduce an opaque k_thread_stack_t which gets instantiated by
K_THREAD_STACK_DECLARE(), this is no longer treated by the compiler
as a character pointer, even though it really is.

To access the real stack buffer within, the result of
K_THREAD_STACK_BUFFER() can be used, which will return a char * type.

This should catch a bunch of programming mistakes at build time:

- Declaring a character array outside of K_THREAD_STACK_DECLARE() and
  passing it to K_THREAD_CREATE
- Directly examining the stack created by K_THREAD_STACK_DECLARE()
  which is not actually the memory desired and may trigger a CPU
  exception

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-01 16:43:15 -07:00
..
cortex_m tests: boot_time: cleanup boot_time test to work on ARM 2017-06-29 07:08:59 -04:00
offsets arm: core: Update core to use struct k_thread 2017-03-30 18:31:05 +00:00
Kconfig arm: dts: Cleanup HAS_DTS 2017-05-15 13:22:54 -04:00
Makefile arm: core: mpu: Add ARM MPU support 2017-04-25 21:53:17 +00:00
__aeabi_atexit.c license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
cpu_idle.S linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
exc_exit.S kernel: fix short time-slice reset 2017-06-02 14:47:01 -04:00
fatal.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
fault.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
fault_s.S linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
irq_init.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
irq_manage.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
irq_offload.c arm: implement __svc on Cortex M0 2017-06-02 02:17:32 -04:00
isr_wrapper.S linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
swap.S stack_sentinel: change cooperative check 2017-06-08 13:49:36 -05:00
sys_fatal_error_handler.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00
thread.c kernel: introduce opaque data type for stacks 2017-08-01 16:43:15 -07:00
thread_abort.c linker: move all linker headers to include/linker 2017-06-18 09:24:04 -05:00