zephyr/subsys/ipc/rpmsg_multi_instance
Carlo Caione 0c2dabb4b9 ipc: rpmsg_multi_instance: Rework instance tracking
This patch is the first step to make the rpmsg_multi_instance usable in
a multi-core scenario.

The current driver is using a local driver variable (instance) to track
the number of allocated instances. This counter is practically used to
allocate to the instance the correct portion of the shared memory.

This is fundamentally wrong because this is assuming that it does exist
only one single shared memory region to split amongs all the allocated
instances.  When the platform has more than one core this is obviously
not the case since each couple of cores are communicating using a
different memory region.

To solve this issue we introduce a new struct rpmsg_mi_ctx_shm_cfg that
is doing two things: (1) it's carrying the information about the shared
memory and (2) it's carrying an internal variable used to track the
instances allocated in that region. The same struct should be used every
time a new instance is allocated in the same shared memory region.

We also fix a problem with the current code where there is a race
between threads when accessing the instance variable, so this patch is
adding a serializing mutex.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-08-27 06:44:08 -04:00
..
CMakeLists.txt
Kconfig ipc: rpmsg_multi_instance: Use only rpsmg_mi_ctx_cfg for configuration 2021-08-27 06:44:08 -04:00
Kconfig.ipm_name_instance
rpmsg_multi_instance.c ipc: rpmsg_multi_instance: Rework instance tracking 2021-08-27 06:44:08 -04:00
rpmsg_multi_instance.h