Commit graph zephyr/doc/kernel
Author SHA1 Message Date
Anas Nashif
f47242fb33 samples: kernel: add object monitor sample
Run a small job server, with short-lived threads and heap-allocated
requests embedding semaphores, mutexes and timers, and next to it a
monitor thread that uses object cores the way a debugging tool would:
every second it redraws the number of objects of each type with the
skipped and dropped counts, and every thread with its state and CPU
share over the last period. A second twister configuration builds it
through CONFIG_TRACING_OBJECT_TRACKING.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-09-29 15:50:16 +02:00
Anas Nashif
7a15118698 samples: kernel: add object cores sample
Show the object core framework from a user's point of view: the
inventory of each object type with its skipped and dropped counts,
which objects are reported (static, run-time registered, in stack
storage, in freed memory, aborted threads, explicitly unregistered),
and the thread, memory slab and system statistics read through
k_obj_core_stats_query(). A second twister configuration builds the
same program through CONFIG_TRACING_OBJECT_TRACKING.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-09-29 15:50:16 +02:00
Anas Nashif
66d52517ce doc: kernel: document the object core registry model
Describe how object types enumerate their permanent objects in place and
the objects initialized at run time from a bounded registry, which
objects are not tracked, when the kernel unregisters objects, and the
build-time and run-time ways of defining an object type. Add the
migration guide and release notes entries for the removed list members,
the object tracking lists and the new options.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-09-29 15:50:16 +02:00
Philipp Steiner
cf56bcd590 samples: precision_timing: demonstrate API usage
Add a software-backed precision clock sample that demonstrates checked time
arithmetic, mandatory clock operations, and PI-driven rate adjustment.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-09-28 07:35:33 -04:00
Philipp Steiner
bcf2abe20e precision_timing: add reusable timing mechanisms
Add signed nanosecond arithmetic, protocol-neutral clock operations, a PTP
clock adapter, and an instance-based generic PI controller. Keep
synchronization policy in protocol consumers.

Signed-off-by: Philipp Steiner <philipp.steiner1987@gmail.com>
2026-09-28 07:35:33 -04:00
Måns Ansgariusson
c6b3c3c6af doc: zassert
Move the assertion documentation out of the Fatal Errors page into a
new "Assertions" page and rewrite it around the module-aware ZASSERT()
API.

The page documents ZASSERT as the recommended runtime assertion API.
It covers the following topics:
* ZASSERT macros
* Kconfig options
* Assertion modules and levels (ZASSERT_OFF/TERSE/ON/VERBOSE)
* Customization of the failure behavior through weak hooks

The legacy __ASSERT() family is documented as a deprecated compatibility
layer over the DEFAULT module.

BUILD_ASSERT() is carried over as well.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-09-25 10:01:43 +02:00
Måns Ansgariusson
5d970607e6 sys: assert: remove the experimental CONFIG_ASSERT_CUSTOM_HEADER
CONFIG_ASSERT_CUSTOM_HEADER let an application inject a
"zephyr_custom_assert.h" at the end of <zephyr/sys/__assert.h> to extend
the assert macros at the preprocessor level. It has always been
experimental and explicitly warned that the internal assert API may change,
so it is removed without a deprecation period, per the experimental API
policy.

Applications that need to customize assertion handling should override the
weak assert hooks instead.

Remove the Kconfig option, the __assert.h include hook and the
assert_custom_header test.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-09-25 10:01:43 +02:00
YunHung Hua
3cce2033df kernel: mutex: document that a mutex must not be freed while in use
A mutex with threads waiting on it keeps their wait queue nodes in its
own memory, so releasing or reusing that memory while the mutex is in
use has never been safe. Since 1b60add1ac ("kernel: mutex: fix
priority inheritance with multiple held mutexes") the same is true of a
locked mutex with no waiters: freeing it used to leak the lock, and now
leaves the owner tracking a list node in memory that no longer belongs
to it.

Neither the mutex documentation nor the k_mutex_lock() reference says
so. State the rule in both places, next to the description of unlocking
and in the API comment where most readers will look. The rule rather
than the mechanism, because the owner's list only exists when priority
inheritance is enabled and is already described in that section.

Signed-off-by: YunHung Hua <oliverhua.us@gmail.com>
2026-09-24 10:01:26 +02:00
Måns Ansgariusson
6411514b9f lib: ring_buffer: new header-only implementation
The new implementation provides a full SPSC ring buffer API, reducing the
size of the ring_buffer struct to 12 bytes(on a 32-bit arch), and increases
the throughput of the ring buffers hot path by ~30% (measured on nRF5340).

The default variant drops the claim/finish and item APIs functionality to
reduce the struct size. During the deprecation period, the old APIs are
still reachable through the CONFIG_RING_BUFFER Kconfig option.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-09-16 07:29:22 +02:00
Måns Ansgariusson
278f633cbb doc: ring_buffer: prefer zero-copy _ptr APIs over claim/finish
Update the ring buffer documentation to lead with the new
ring_buf_put_ptr/commit and ring_buf_get_ptr/consume zero-copy APIs as
the recommended way to access the ring buffer memory directly. The
legacy ring_buf_*_claim/finish APIs are now noted as deprecated and
slated for removal.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-09-16 07:29:22 +02:00
Remo Senekowitsch
403a7d79ad doc: kernel: fix typos
While reading the documentation, I cleaned up these typos.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-13 12:57:37 +02:00
Måns Ansgariusson
da99c80547 doc: kernel: add a dedicated spinlock documentation page
Extract the spinlock documentation out of the SMP page into its own page
under the kernel synchronization services, and expand it with usage
guidance, examples and rules for correct use.

The SMP page keeps a short summary and links to the new page.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-09-08 19:17:40 -04:00
Christoph Busold
158ebbd44c kernel: userspace: Support arbitrary futex addresses
This removes k_futex from the kobject table and allows any address
accessible to userspace to be used as futex and fixes #25497.

Instead of different wait queues per futex, this solution uses a
single wait queue for all threads waiting on any futex. The futex
address is stored in the thread structure. On wake, the kernel
walks through the queue and wakes either the highest priority or
all threads waiting on the specified futex address.

This is more lightweight than #42087 and more efficient for smaller
numbers of threads, but does not scale well to large numbers of
threads waiting on different futexes.

Add a test for the correct order when waking only one thread.

Signed-off-by: Christoph Busold <cbusold@qti.qualcomm.com>
2026-09-04 21:45:07 -04:00
Remo Senekowitsch
b17d93039c doc: interrupts: reword explanation of local ISR declaration parser
I found this paragraph hard to understand grammatically.

Co-authored-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-04 13:41:56 -04:00
Remo Senekowitsch
7f12a92025 doc: interrupts: add missing comma
The single comma split the sentence in a way that doesn't make sense.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-04 13:41:56 -04:00
Remo Senekowitsch
ffd0f66884 doc: interrupts: uppercase ISR in prose
I noticed this inconsistency and searched the documented for all uses of
lowercase "isr" in prose, replacing them with "ISR".

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-04 13:41:56 -04:00
Remo Senekowitsch
57ac33452e doc: interrupts: improve nested interrupt ascii art
I found the previous ascii art a little hard to parse.

The pointers to the next level are now directed at the beginning of
a controller. Previously, I was wondering if the higher level somehow
pointed at a specific line in the lower level.

Unfortunately, the monospace font used in the rendered HTML
documentation doesn't perfectly connect the box drawing characters.

It should also be noted that this version is quite a bit wider than
the previous one. For the standard text width of the rendered HTML
documentation, it fits nicely. But, on small screens, the diagram will
overflow the screen width more quickly.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-04 13:41:56 -04:00
Remo Senekowitsch
e2d26b9c40 doc: interrupts: describe ISRs as low-latency
The fact that ISRs preempt most normal threads (preemptible and
cooperative) doesn't necessarily mean an ISR has a low overhead.

It is more accurate to describe ISRs as having low latency in this
context. The fact that they preempt most threads means there is
usually a very short amount of time between an IRQ being raised
and its associated ISR being executed. This stands in contrast with
normal threads, which, after becoming ready, often have to wait for
higher-priority threads to finish their work or for cooperative threads
to yield.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-04 13:41:56 -04:00
Anas Nashif
1bb3edbfa6 irq: fail loudly when direct interrupts are unsupported
The ARCH_*_DIRECT_* hooks that IRQ_DIRECT_CONNECT() and
ISR_DIRECT_DECLARE() expand to are only defined by architectures
implementing direct interrupts. The stubs in arch_interface.h are
documentation only, guarded by __DOXYGEN__, so on every other
architecture the macros are simply undefined and survive preprocessing
untouched. The result is that

    ISR_DIRECT_DECLARE(my_isr) { ... }

misparses as a K&R function definition of a function named
ARCH_ISR_DIRECT_DECLARE, and the compiler reports a missing return type
instead of the missing feature. On x86_64 in particular this is easy to
mistake for a mistake in the caller's code.

Define the ARCH_IRQ_DIRECT_CONNECT() and ARCH_ISR_DIRECT_DECLARE()
hooks as BUILD_ASSERT() failures when CONFIG_ARCH_HAS_DIRECT_INTERRUPTS
is not set, so the diagnostic names the feature and points at the
offending line. Only these two API entry points are stubbed: the
HEADER/FOOTER/PM hooks are reachable solely from inside a direct ISR
body created with ISR_DIRECT_DECLARE(), so the assertion there already
covers them, and RX defines ARCH_ISR_DIRECT_HEADER()/_FOOTER() for its
internal ISR accounting without supporting direct interrupts, which
stubbing them would break. The guard has to test the Kconfig symbol
rather than the hooks themselves, because the arch-level irq.h headers
include <zephyr/irq.h> before defining them.

Exclude the block from Doxygen too, so that the documented stubs in
arch_interface.h stay the only visible definitions of the hooks;
otherwise they are reported as new undocumented API by the
documentation coverage check.

Assisted-by: Claude:claude-opus-5
Assisted-by: Claude:claude-fable-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-09-04 13:41:41 -04:00
Remo Senekowitsch
3994c841bc doc: workqueue: mention cooperative system workqueue priority
When reading the workqueue documentation, the priority of a workqueue
seemed important to me, so I checked the default priority of the system
workqueue. It being cooperative was unintuitive for me, since I thought
I could use it for low-priority background tasks. I asked about this on
Discord, and people generally confirmed that the system workqueue is not
ideal for this use case.

Link to question on Discord:
https://discord.com/channels/720317445772017664/720317445772017667/1543206806791389214

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-04 06:23:02 -04:00
Remo Senekowitsch
6493305b09 doc: slabs: remove incorrect heap comparison
It is also possible to define more than one heap.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-03 18:48:29 -04:00
Remo Senekowitsch
df1208ff5a doc: scheduling: link to CPU idling APIs
I was reading the scheduling documentation and noticed that mentions
of the CPU idling functions are not links to the relevant API
documentation, as is usually the case.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-03 09:40:08 +02:00
Remo Senekowitsch
3b017c050d doc: scheduling: fix typo
While reading the documentation, I fixed this typo along the way.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-03 09:40:08 +02:00
Remo Senekowitsch
c76d15f42b doc: events: add missing API link
I noticed there is no direct link to the API of `k_event_wait_all` while
reading the documentation.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-02 19:19:39 +01:00
Remo Senekowitsch
64c6efeef8 doc: mutexes: add missing API links
I cleaned this up while reading the documentation.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-02 19:19:39 +01:00
Remo Senekowitsch
33664fb1a8 doc: polling: improve sentence clarity
The structure of this sentence was a little convoluted, I think this one
makes it clearer how events and conditions are related and what a call
to `k_poll` waits for.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-02 19:18:52 +01:00
Remo Senekowitsch
e99c567246 doc: polling: cleanup grammar
These are some grammar cleanups I made while reading the documentation.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-02 19:18:52 +01:00
Remo Senekowitsch
74460ca133 doc: semaphores: fix grammar
I cleaned this up while reading the documentation.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-01 21:05:27 -04:00
Remo Senekowitsch
e47d106d00 doc: semaphores: add missing API links
I cleaned this up while reading the documentation.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-09-01 21:05:27 -04:00
Dimitri Varpusvuori
52b4b49644 sys: sflist: make flag capacity ABI-dependent
sys_sflist stores flags in unused low bits of node links. The number of
available bits follows the ABI's natural pointer alignment, but the generic
header currently forces pointer-size alignment and globally requires two
bits.

That guarantee does not hold for borrowed nodes such as intrusive k_queue
items, which are caller-owned objects cast to sys_sfnode_t. On ABIs with
four-byte pointers and two-byte pointer alignment, only bit 0 is reliably
free.

Remove the forced alignment, expose SYS_SFLIST_FLAG_BITS, and let consumers
assert their own requirements. k_queue and the MMU free-page list each
require one bit. Make the unit test honor the capacity reported by the ABI
and clarify the intrusive queue alignment documentation.

This preserves generic flagged lists and safely supports one-bit ABIs.

Assisted-by: ChatGPT:gpt-5.6
Signed-off-by: Dimitri Varpusvuori <dimitri.varpusvuori@gmail.com>
2026-08-31 21:36:01 -04:00
Remo Senekowitsch
9e93a73a14 doc: workqueue: add missing comma
I struggled to understand the structure of this sentence without the
comma.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-08-31 21:34:59 -04:00
Remo Senekowitsch
ecb7ab14dc doc: workqueue: remove misplaced backtick
I cleaned this up while reading the documentation.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-08-31 21:34:59 -04:00
Dhruv Menon
5a0e1f9eb7 kernel: add Pugh skip list timeout backend
This commit introduces a new timeout backend using a
Pugh skip list, which allows for O(log N) insertion
and removal of timeouts. The skip list maintains
a same-tick firing order and has no capacity
limit, making it suitable for systems with many
concurrent timeouts. The implementation includes
necessary Kconfig options and updates to the timeout
management code to support this new backend.

Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
2026-08-30 16:43:01 -04:00
Remo Senekowitsch
1da4cec0e3 doc: threads: fix typo
While reading through the documentation of threads, I cleaned up this
typo I noticed along the way.

Signed-off-by: Remo Senekowitsch <remo@buenzli.dev>
2026-08-27 22:11:56 -04:00
Anas Nashif
55d0693e65 kernel: irq: provide namespaced k_irq_* equivalents
The new pending-state and active-IRQ operations use the k_irq_
namespace, leaving the seven legacy run-time interrupt APIs as the
only unprefixed ones in irq.h. Provide namespaced equivalents so the
API family is uniform and new code has a collision-free spelling:
k_irq_lock(), k_irq_unlock(), k_irq_enable(), k_irq_disable(),
k_irq_is_enabled(), k_irq_connect_dynamic() and
k_irq_disconnect_dynamic(), all ALWAYS_INLINE wrappers with
behaviour identical to the legacy names.

The unprefixed names remain fully supported and are not deprecated:
they have on the order of five thousand call sites in the tree alone
and far more out of tree, so any deprecation decision needs
migration data and belongs to a wider discussion. They also must
stay function-like macros rather than become inline functions:
vendor HAL headers declare functions with these exact names (the
Realtek Ameba ROM ABI declares irq_enable(IRQn_Type)), and a macro
coexists with such a declaration where a function definition would
conflict.

The compile-time constructs (IRQ_CONNECT, IRQ_DIRECT_CONNECT,
ISR_DIRECT_*) are left as they are: they live outside the contested
function namespace, so renaming them would be churn without benefit.

Document the aliases in the interrupts service documentation and the
release notes, and switch the irq_pending and irq_active test
applications to the namespaced spellings so the aliases have
build and runtime coverage on Cortex-M and Cortex-A/R.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-08-25 14:36:35 -07:00
Benjamin Cabé
0a22328a73 scripts: gen_relocate_app: drop deprecated pattern expansion
Stop glob-expanding the entries of a zephyr_code_relocate(FILES ...)
list. Expanding a pattern to several files has been deprecated since
Zephyr 4.2; the supported way is to expand it in CMake with
file(GLOB ...) and pass the resulting file names.

A pattern is now rejected with a named error instead of being silently
accepted, so the failure cannot go unnoticed. Entries without pattern
characters keep their current behaviour, including the "Not found"
warning for a missing file. All in-tree callers already pass explicit
file names.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
2026-08-24 18:43:22 +02:00
Mayur Salve
1b60add1ac kernel: mutex: fix priority inheritance with multiple held mutexes
The existing implementation unconditionally restores owner_orig_prio on
unlock, ignoring other held mutexes that still have high-priority waiters.
This causes incorrect priority restoration in nested mutex scenarios and
requires mutexes to be released in strict reverse acquisition order.

Additionally, priority boosts were not propagated through ownership chains
when the mutex owner was itself blocked on another mutex.

This change adds per-thread held_mutexes tracking and mutex_pended_on
pointer to enable:
- Correct priority recalculation on unlock by scanning all remaining held
  mutexes
- Chained priority inheritance through the full ownership chain
- Deadlock detection: assert on K_FOREVER circular ownership where
  every cycle member also waits forever; bounded chain walk prevents
  livelock on cycles not involving the current thread
- Per-thread orig_prio field records true pre-inheritance priority,
  fixing priority floor when mutexes are released in non-LIFO order

struct k_thread grows by three pointers plus a byte in default builds
(held_mutexes, mutex_pended_on, orig_prio).

Signed-off-by: Mayur Salve <msalve@qti.qualcomm.com>
2026-08-18 17:19:28 -04:00
Måns Ansgariusson
dc8e269eee doc: ring_buffer: Add ring buffer [get|put]_ptr* APIs
Replace the explanation of the usage of ring_buf_[get|put]_[claim|free]
APIs with the new ring_buf_[get|put]_ptr* APIs as the preferred way to do
zero-copy access to ring buffers. The old APIs are still available but are
now slated to be deprecated and will be removed in the future.

Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
2026-08-17 16:25:21 -04:00
Nicolas Pitre
8528d27929 doc: document the generic tickless system-timer core
Describe the generic core on the system timer drivers page, where the
sys_clock_* contract lives, so a driver author finds it alongside
sys_clock_set_timeout() and sys_clock_elapsed(); add the release notes
entry and a migration-guide note steering out-of-tree tickless drivers
toward the header instead of tracking the kernel interface by hand.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-08-12 19:27:28 -04:00
Nicolas Pitre
c7fc708d3e doc: document sys_clock_no_timeout() and sys_clock_idle_enter()
Describe both hooks on the system timer drivers page, where the
sys_clock_* contract lives, and record the two deprecations they replace
in the migration guide and release notes. A table maps the four states,
running or idle crossed with something pending or not, onto the call each
one produces.

Both replaced signals keep working for out-of-tree drivers through the
hooks' default implementations, until removal after the usual
deprecation period.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-08-12 19:27:28 -04:00
Nicolas Pitre
5ea5a70bfa doc: give system timer drivers their own page
The kernel timing page mixes two audiences. Most of it is what an
application sees: time units, uptime, timeouts, conversions. The driver
interface, the locking it runs under and the SMP notes are for whoever
writes or ports a timer driver, and that reader has no need of the rest.

Move those three sections to a page of their own and leave a pointer. The
moved text is unchanged but for the section levels and one cross-reference
that used to point further down the same page; each page gains a sentence
introducing the other.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2026-08-12 19:27:28 -04:00
Anas Nashif
7a72151634 kernel: smp: replace SMP_BOOT_DELAY with per-CPU devicetree deferral
CONFIG_SMP_BOOT_DELAY was a global, application-level switch that made
the kernel skip starting every secondary CPU at boot, used in-tree only
by two tests and in practice by one platform class (intel_adsp, where
the host or PM policy brings DSP cores up on demand). Boot topology is
a hardware/platform property, and all-or-nothing is needlessly coarse.

Replace it with a per-CPU devicetree flag, zephyr,deferred-start, on
the /cpus children (mirroring zephyr,deferred-init for devices):
z_smp_init() now always runs and simply skips flagged CPUs, which are
brought up at run time with the existing k_smp_cpu_start() (or
k_smp_cpu_resume()). Deferral is per CPU, so asymmetric bring-up
(start some cores at boot, defer others) is now expressible, and the
special-case branch disappears from the boot path.

The flag is declared in the common cpu.yaml binding. The lookup uses
DT_PROP_OR() so cpu nodes whose binding does not cover the property
simply cannot be deferred rather than breaking the build; a binding
for the intel,x86_64 compatible used by qemu_x86_64's cpu nodes was
missing entirely and is added.

The two users are converted: tests/kernel/multiprocessing/
smp_boot_delay marks the secondary CPUs in per-board overlays (both
tests pass on qemu_x86_64) and tests/boards/intel_adsp/smoke gains
overlays for its four platforms (all build). Normal SMP boot is
unaffected (verified on qemu_x86_64, all CPUs online).

Out-of-tree users migrate by dropping CONFIG_SMP_BOOT_DELAY=y and
adding zephyr,deferred-start to the deferred cpu nodes in their board
overlay.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-08-11 17:01:49 -04:00
Jérôme Pouiller
bc977072df kernel: poll: add K_POLL_TYPE_LIFO_DATA_AVAILABLE support
This allows to watch k_lifo using k_poll().

No changes were required in kernel/poll.c. The existing logic already
operates on event->queue for K_POLL_TYPE_DATA_AVAILABLE, which is
compatible with both k_fifo and k_lifo since they share the same in-memory
layout (a leading struct k_queue).

In fact, the user was already able to poll k_lifo if he casted it on
k_fifo. This patch only add the required aliases to make the support for
k_lifo official.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2026-08-08 16:34:30 -04:00
Cesar Vandevelde
a92cd24c3c kernel: msg_q: add K_MSGQ_DEFINE_TYPE for automatic size/alignment
Introduces K_MSGQ_DEFINE_TYPE() and K_MSGQ_DEFINE_STATIC_TYPE() helper
macros that let the user define message queues with the correct size and
alignment for given message type.

Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
2026-08-04 18:46:53 +01:00
Cesar Vandevelde
5ae5aa23d7 kernel: msg_q: add K_MSGQ_DEFINE_STATIC
Introduce a macro to define private (file scope) message queues. The
K_MSGQ_DEFINE() macro cannot be combined with the `static` keyword because
the macro defines 2 variables (unlike e.g. K_SEM_DEFINE or
K_TIMER_DEFINE), so a dedicated macro is necessary.

Signed-off-by: Cesar Vandevelde <cesar.vandevelde@gmail.com>
2026-08-04 18:46:53 +01:00
Daniel Leung
258a5dd9c7 doc: kernel/ipi: fix sample on calling k_ipi_work_signal()
Should be calling to k_ipi_work_signal() instead of
k_ipi_signal().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-07-23 18:02:04 -04:00
Henrik Brix Andersen
67e300f954 doc: kernel: services: threads: workqueue: remove old note
Remove note comparing current behavior to pre-v2.6.0 behavior. As Zephyr
v2.6.0 was released 5 years ago, this note is no longer relevant.

The last parapgraph is already covered by the best practices section.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-07-23 18:01:53 -04:00
Rupesh Majhi
bb0f98fc9a doc: fix typos in ring buffer and libcsp guides
Fix two spelling typos in the documentation:
- 'strucures' -> 'structures' (data structures / ring buffer page)
- 'snipet' -> 'snippet' (libcsp external manifest page)

Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
2026-07-22 18:31:52 -04:00
Anas Nashif
a9637109bc Revert "doc: document the sys_clock timeout API changes"
This reverts commit 448024149d.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-22 10:27:24 -04:00
Anas Nashif
7d6c2f6ecd Revert "doc: document the generic tickless system-timer core"
This reverts commit 4171a0b8ec.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2026-07-22 10:27:24 -04:00