zephyr/subsys/portability/cmsis_rtos_v2
Johan Hedberg 3fbf12487c kernel: Introduce a way to specify minimum system heap size
There are several subsystems and boards which require a relatively large
system heap (used by k_malloc()) to function properly. This became even
more notable with the recent introduction of the ACPICA library, which
causes ACPI-using boards to require a system heap of up to several
megabytes in size.

Until now, subsystems and boards have tried to solve this by having
Kconfig overlays which modify the default value of HEAP_MEM_POOL_SIZE.
This works ok, except when applications start explicitly setting values
in their prj.conf files:

$ git grep CONFIG_HEAP_MEM_POOL_SIZE= tests samples|wc -l
     157

The vast majority of values set by current sample or test applications
is much too small for subsystems like ACPI, which results in the
application not being able to run on such boards.

To solve this situation, we introduce support for subsystems to specify
their own custom system heap size requirement. Subsystems do
this by defining Kconfig options with the prefix HEAP_MEM_POOL_ADD_SIZE_.
The final value of the system heap is the sum of the custom
minimum requirements, or the value existing HEAP_MEM_POOL_SIZE option,
whichever is greater.

We also introduce a new HEAP_MEM_POOL_IGNORE_MIN Kconfig option which
applications can use to force a lower value than what subsystems have
specficied, however this behavior is disabled by default.

Whenever the minimum is greater than the requested value a CMake warning
will be issued in the build output.

This patch ends up modifying several places outside of kernel code,
since the presence of the system heap is no longer detected using a
non-zero CONFIG_HEAP_MEM_POOL_SIZE value, rather it's now detected using
a new K_HEAP_MEM_POOL_SIZE value that's evaluated at build.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-12-20 11:01:42 +01:00
..
CMakeLists.txt include: Prefix includes to use a scope 2022-04-08 19:03:32 +02:00
Kconfig COVERAGE: Fix COVERAGE_GCOV dependencies 2023-08-24 15:36:31 +02:00
event_flags.c kernel: Modify the signature of k_mem_slab_free() 2023-09-03 18:20:59 -04:00
kernel.c subsystems: migrate includes to <zephyr/...> 2022-05-09 12:07:35 +02:00
mempool.c kernel: Introduce a way to specify minimum system heap size 2023-12-20 11:01:42 +01:00
msgq.c kernel: Introduce a way to specify minimum system heap size 2023-12-20 11:01:42 +01:00
mutex.c kernel: Modify the signature of k_mem_slab_free() 2023-09-03 18:20:59 -04:00
semaphore.c kernel: Modify the signature of k_mem_slab_free() 2023-09-03 18:20:59 -04:00
thread.c portability: fix thread function signatures 2023-10-30 12:24:34 +01:00
thread_flags.c sys_clock: define NSEC_PER_MSEC 2022-09-01 16:29:25 -04:00
timer.c kernel: Modify the signature of k_mem_slab_free() 2023-09-03 18:20:59 -04:00
wrapper.h subsystems: migrate includes to <zephyr/...> 2022-05-09 12:07:35 +02:00