0c2dabb4b9
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> |
||
---|---|---|
.. | ||
ipc_service.h | ||
ipc_service_backend.h | ||
rpmsg_multi_instance.h | ||
rpmsg_service.h |