zephyr/cmake
Rodrigo Peixoto 7e44469dcc zbus: improve the way of storing observers
ZBus stores observers in two ways: statically using a list and dynamically
using a memory slab. Both present limitations. Static observers work only
for channel definition. The dynamic observers rely on a memory slab that
forces the user to manage its size to avoid issues with adding
observers. This commit fixes the static allocation problem by using the
iterable sections for allocating observation data and replacing the VDED
execution sequence since now it is possible to prioritize static observer
execution. All the runtime observers are dynamically allocated on the heap
instead of a specific memory pool.

BREAK changes (only internal, not APIs):

* ZBus channel metadata changed. Remove the observers' static array
pointer. Rename the `runtime_observers` pointer to `observers`. Add
`observer_start_idx` and `observer_end_idx`;
* Change the VDED execution sequence. The position (on definition time),
the priority in conjunction with the lexical order, is considered for
static post-definition time observers. At last, the runtime observer
follows the adding sequence;
* Replace the `CONFIG_ZBUS_RUNTIME_OBSERVERS_POOL_SIZE` with
`CONFIG_ZBUS_RUNTIME_OBSERVERS`.

New APIs:

* New iterable section iterators (for channels and observers) can now
receive a user_data pointer to keep context between the function calls;
* New `ZBUS_LISTENER_DEFINE_WITH_ENABLE(_name, _cb, _enable)` and
`ZBUS_SUBSCRIBER_DEFINE_WITH_ENABLE(_name, _queue_size, enable)` that
enable developers define disabled observers. They need to be enabled
during runtime to receive notifications from the bus;
* `ZBUS_CHAN_ADD_OBS` macro for adding post-definition static observers of
a channel.

Important changes:

* Move the ZBus LD file content to the `common-ram.ld` LD file. That was
necessary to make ZBus compatible with some Xtensa and RISCV boards.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2023-08-29 10:18:55 +02:00
..
app
bintools ARC: MWDT: rework GNU helper tools usage 2023-06-17 07:44:31 -04:00
compiler cmake/toolchain: Support LLVM source profiling/coverage for native boards 2023-08-28 10:35:21 +02:00
emu twister: add support for custom emulator in simulator 2023-08-02 17:35:26 +02:00
flash west: runners: uf2: Add new UF2 runner. 2023-02-20 12:50:38 +01:00
ide
linker cmake/toolchain: Support LLVM source profiling/coverage for native boards 2023-08-28 10:35:21 +02:00
linker_script zbus: improve the way of storing observers 2023-08-29 10:18:55 +02:00
makefile_exports
modules cmake: code relocation: Add support for absolute windows paths 2023-08-25 12:21:49 +02:00
reports
sca cmake: sca: codechecker: Support storing results 2023-08-23 14:45:03 +02:00
toolchain llvm: use proper syntax for --config option 2023-08-23 16:07:54 +01:00
usage
util
cfb.cmake scripts: move gen_cfb_font_header.py to scripts/build 2022-07-12 10:03:45 +02:00
extra_flags.cmake cmake: fix improper use of separate_arguments 2022-09-05 10:22:05 +02:00
gcc-m-cpu.cmake soc: arm64: Add agilex5 soc folder and its configurations 2023-07-25 16:58:01 +00:00
gcc-m-fpu.cmake cmake: gcc: Fix Cortex-R52 FPU type 2022-10-19 00:28:33 +09:00
gen_version_h.cmake cmake: generalize VERSION infrastructure for better reuse 2023-05-17 13:56:58 +02:00
hex.cmake
kobj.cmake scripts: move gen_kobject_list.py to scripts/build/gen_kobject_list.py 2022-07-12 10:03:45 +02:00
mcuboot.cmake cmake: add Zephyr image output files as byproducts 2023-08-22 12:31:43 +02:00
package_helper.cmake cmake: update package helper description to use EXTRA_CONF_FILE var 2023-05-23 16:40:21 +02:00
pristine.cmake
target_toolchain_flags.cmake
verify-toolchain.cmake cmake: rework of host tools and generic toolchain handling 2022-09-01 15:59:43 +02:00
vif.cmake USB-C: genVIF: Cleanup and add support to pick static data from input 2023-05-26 13:54:43 -04:00