Commit Graph

14 Commits

Author SHA1 Message Date
Vukan Turkulov 4a17c1ba25 doc: specify thread safety for each data structure
The documentation of "Kernel/Data Structures" incorrectly
states that 'all provided structures are uniformly unsynchronized;
access to them is not threadsafe by default'.
In reality, some of them are threadsafe and some are not.
This might discourage users from using threadsafe data structures
where applicable, or mislead users into adding unnecessary locks.

This proposal addresses the issue by specifying thread safety
for each provided data structure.
My assessment of thread safety is based purely on source code analysis;
hence an expert verification would be appreciated.

Signed-off-by: Vukan Turkulov <vukant@gmail.com>
2026-04-20 17:54:59 +08:00
Tom Burdick ff9b6fc90a doc: Fix typo in SPSC lockfree queue docs
SPSC was typoed as MPSC in the SPSC queue docs.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2026-04-20 17:31:31 +08:00
Benjamin Cabé 23e3ade008 doc: kernel: fix improper Sphinx C domain usage
fixed usage of wrong C roles (e.g. `:c:struct:` instead of `:c:type:`)
which Breathe tolerates but can cause trouble when using other systems.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-20 17:23:30 +08:00
Tom Burdick f46a106d9d sys: Add a lockfree mpsc and spsc queues
Moves the rtio_ prefixed lockfree queues to sys alongside existing
mpsc/spsc pbuf, ringbuf, and similar queue-like data structures.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2026-04-20 17:22:54 +08:00
Andrej Butok 4dcfed3541 doc: Fix double 'the'
Fix double 'the' in all .rst documentation.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-04-20 16:49:06 +08:00
Andrej Butok 1acb239a41 doc: mpsc: Add missed 'end'
Adds missed 'end' in the 'Internals' chapter.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-04-20 16:49:01 +08:00
Andrej Butok 523881f414 doc: slist: fix duplicated sys_sfnode_flags_get()
Replace duplicated sys_sfnode_flags_get() by sys_sfnode_flags_set().

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-04-20 16:47:41 +08:00
Benjamin Cabé eda13e983c doc: ring_buffer: fix typos and incoherences
Fixed an incorrect mention of buffer size being expressed in 32-byte
words for data item mode when it's in fact 32-bit.
Fixed a few broken references to C functions and structs.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-04-20 16:43:43 +08:00
Tomasz Moń 19dfece338 doc: Fix kernel data structures typos
Add missing colons to properly render C references.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2026-04-20 16:02:19 +08:00
Henri Xavier 33c6da6f00 ring_buffer: Introduce `RING_BUF_ITEM_SIZEOF`
Currently, to compute the 'item' size in a ring buffer, we have
`SIZE32_OF`.

Several issues with this:
- `SIZE32_OF` only works on variables, not types, due to an extra
 parenthesis pair. Indeed, `sizeof((int))` is not valid C, whereas
 `sizeof((my_var))` is.
- `SIZE32_OF` is not a proper public API
- `SIZE32_OF` rounds down if the argument size is not a multiple
 of 4 bytes.

Thus, we introduce a proper `RING_BUF_ITEM_SIZEOF`, fixing the
aforementioned issues.

Signed-off-by: Henri Xavier <datacomos@huawei.com>
2026-04-20 16:00:42 +08:00
Krzysztof Chruscinski 5775bd6078 doc: kernel: Add documentation to spsc_pbuf
Add documentation to spsc_pbuf module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2026-04-20 15:49:18 +08:00
Aleksandar Markovic 188ad825e0 doc: Fix links to Zephyr include directory on Github
At some recent point, directory <zephyr-root>/include was moved to
<zephyr-root>/include/zephyr. However, links from documentation to
Zephyr source on Github were not updated. Update them now.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
2026-04-20 15:45:31 +08:00
Yuval Peress f206e9d4b2 include: update documentation to use zephyr/ prefix
Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2026-04-20 15:45:30 +08:00
Anas Nashif 421fc64ec0 doc: move data structures under kernel/
Move this section under the kernel and alongside other core and low
level features that are tied to the kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-04-20 15:44:17 +08:00