zephyr/tests/kernel
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
..
alert/alert_api tests: Remove camel case and fix coding style 2017-06-29 07:00:50 -04:00
arm_irq_vector_table tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
arm_runtime_nmi tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
bitfield tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
common tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
context tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
critical tests: critical: Convert testcase into ztest 2017-08-01 08:46:48 -04:00
errno tests: errno: convert test case to use ztest 2017-08-01 08:46:48 -04:00
fatal kernel: introduce opaque data type for stacks 2017-08-01 16:43:15 -07:00
fifo/fifo_api tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
fp_sharing tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
gen_isr_table tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
irq_offload tests: irq_offload: Convert test case to use ztest 2017-08-01 08:46:48 -04:00
libs tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
lifo/lifo_api tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
mbox/mbox_api tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
mem_heap/mheap_api_concept tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
mem_pool tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
mem_slab tests: Remove camel case and fix coding style 2017-06-29 07:00:50 -04:00
msgq/msgq_api tests: Remove camel case and fix coding style 2017-06-29 07:00:50 -04:00
multilib tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
mutex tests: Remove camel case and fix coding style 2017-06-29 07:00:50 -04:00
obj_tracing drivers, net: Clean up semaphore initialization 2017-07-27 15:23:07 -04:00
pending tests: replace filters in testcase files 2017-06-28 09:51:40 -05:00
pipe/pipe_api tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
poll kernel: make K_.*_INITIALIZER private to kernel 2017-07-10 11:44:56 -07:00
profiling/profiling_api tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
protection tests: protection: don't do exec tests on x86 2017-07-10 11:44:56 -07:00
queue tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
semaphore/sema_api tests: Remove camel case and fix coding style 2017-06-29 07:00:50 -04:00
sleep tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
sprintf tests: kernel: sprintf: Fix build warning. 2017-07-19 11:16:52 -04:00
stack/stack_api tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
stackprot tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
static_idt tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
systhreads tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
test_build tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
threads tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
tickless tests: tickless: fix building of test 2017-06-29 13:14:18 -05:00
timer kernel: make K_.*_INITIALIZER private to kernel 2017-07-10 11:44:56 -07:00
workq tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
xip tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00