zephyr/include/misc
Andy Ross fe04adf99b lib/os: Conditionally eliminate alloca/VLA usage
MISRA rules (see #9892) forbid alloca() and family, even though those
features can be valuable performance and memory size optimizations
useful to Zephyr.

Introduce a MISRA_SANE kconfig, which when true enables a gcc error
condition whenever a variable length array is used.

When enabled, the mempool code will use a theoretical-maximum array
size on the stack instead of one tailored to the current pool
configuration.

The rbtree code will do similarly, but because the theoretical maximum
is quite a bit larger (236 bytes on 32 bit platforms) the array is
placed into struct rbtree instead so it can live in static data (and
also so I don't have to go and retune all the test stack sizes!).
Current code only uses at most two of these (one in the scheduler when
SCHED_SCALABLE is selected, and one for dynamic kernel objects when
USERSPACE and DYNAMIC_OBJECTS are set).

This tunable is false by default, but is selected in a single test (a
subcase of tests/kernel/common) for coverage.  Note that the I2C and
SPI subsystems contain uncorrected VLAs, so a few platforms need to be
blacklisted with a filter.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-28 10:06:35 -08:00
..
__assert.h misc: Add k_panic on assert 2019-02-02 15:58:33 -08:00
byteorder.h headers: Fix headers across the project 2018-09-17 15:49:26 -04:00
dlist.h misc/dlist: Swap insertion API for a faster one 2019-02-01 15:57:21 -05:00
errno_private.h headers: Fix headers across the project 2018-09-17 15:49:26 -04:00
fdtable.h lib: fdtable: Change ioctl vmethod signature to take va_list 2018-12-14 13:21:31 +02:00
gcov.h tests: coverage: Add Gcov support. 2019-01-16 06:12:33 -05:00
libc-hooks.h libc: newlib: Rename adhoc read/write implementation for stdin/stdout 2019-02-26 11:36:33 -06:00
list_gen.h include: misc: list_gen: Fix possible undefined behavior 2018-12-07 09:06:34 -05:00
mempool_base.h misc: mempool: Using distinct macro identifiers 2018-10-31 19:43:47 -04:00
mempool.h headers: Fix headers across the project 2018-09-17 15:49:26 -04:00
printk.h printk: don't print incorrect 64-bit integers 2019-01-18 08:23:15 -08:00
rb.h lib/os: Conditionally eliminate alloca/VLA usage 2019-02-28 10:06:35 -08:00
reboot.h headers: Fix headers across the project 2018-09-17 15:49:26 -04:00
ring_buffer.h headers: Fix headers across the project 2018-09-17 15:49:26 -04:00
sflist.h include: misc: list_gen: Fix possible undefined behavior 2018-12-07 09:06:34 -05:00
slist.h include: misc: list_gen: Fix possible undefined behavior 2018-12-07 09:06:34 -05:00
stack.h include: misc: Use logger in STACK_ANALYZE macro 2019-02-26 11:35:03 +01:00
util.h include: misc: util.h: Rename min/max to MIN/MAX 2019-02-14 22:16:03 -05:00