Replace spsc_pbuf with pbuf implementation dedicated to
be used by IcMsg based backends.
The pbuf is written on top of simple read/write semantics
with minimal footprint and code complexity
Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
This change fixes the deregister functionality for
icmsg backend. There are two changes:
Memory access layer was not initialized properly
when the endpoint was registered again. This lead to
memory fault when attepmt to write to the buffer was
done.
Mbox driver was initialized before memory access layer
was initialized. This could lead to race condition
where immediately after the mbox driver was initialized,
the receiving work is scheduled due to pending interrupt.
In that case an attempt to read from garbage address will
occur.
Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
icmsg library was implemented as a ipc_service backend. It is a simple
library with minimal feature set. To preserve its simplicity while
adding more features it is useful to introduce separated ipc_service
backends with added features. To reuse most of the icmsg code for the
simplest backend and other including more features, the core of icmsg
is separated from the simplest ipc_service to an icmsg module which
can be used by multiple backends.
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
After magic is read during bound procedure, trigger an
initial data read. This is to ensure data is not missed
when piggybacked on magic's exchange interrupt.
Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Add flags option to init call and a flag to use cache.
Add Kconfig choice to pick how to approach cache. Cache can be
enforced in all spsc_pbuf instances, disable in all, or runtime selected
based on configuration flag. Option is added to allow memory footprint
savings.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Move icmsg_buf to lib/os and rename to spsc_pbuf (Single Producer
Single Consumer Packet Buffer). It is a generic module and initially
was created as internal module for ipc service.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
In order to bring consistency in-tree, migrate all subsystems code to
the new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit adds ipc backend, that relies on simple
inter core messaging buffer also added by this commit.
This backend is configurable with DT overlay. Each
ipc instance could be defined with ipc-icmsg commpatible.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>