zephyr/tests
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
..
benchmarks timing_info: fix how stacks are referenced 2017-07-26 05:53:14 -04:00
bluetooth build: workaround build bug in tests 2017-07-27 14:09:40 -04:00
booting/stub license: Replace Apache boilerplate with SPDX tag 2017-01-19 03:50:58 +00:00
compliance
crypto tests: crypto: Update ECC Diffie-Hellman and DSA tests 2017-08-01 10:35:06 -04:00
drivers tests: disable building of FXOS8700 sensor for all boards 2017-07-28 09:40:38 -05:00
include tests: crypto: Update ECC Diffie-Hellman and DSA tests 2017-08-01 10:35:06 -04:00
kernel kernel: introduce opaque data type for stacks 2017-08-01 16:43:15 -07:00
lib/json tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
net tests: mqtt: Add a mqtt tls test case 2017-07-28 11:25:43 +03:00
power tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
shell tests: shell: Filter on UART_CONSOLE support to enable more boards 2017-06-29 07:07:31 -04:00
subsys tests: Remove camel case and fix coding style 2017-06-29 07:00:50 -04:00
unit tests: remove testcase.ini files 2017-06-21 20:56:53 -04:00
ztest tests/ztest: Add ztest_test_pass() 2017-06-21 21:52:50 -04:00
Kconfig tests: Introduced new config option to add extra stack size for tests. 2017-02-13 11:39:03 -08:00
Makefile
Makefile.test