The `zephyr_code_relocate` now supports the NOINIT memory type in addition
to DATA, TEXT and BSS. This patch documents its usage.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
This patch improves the formatting of the "Additional Configurations"
section of the "Code And Data Relocation" document.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
Includes explanation of the min-heap’s properties, constraints and
explains about the uses cases of min-heap. It also contains references
to Sample Application and min-heap API
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
The documentation did not state clearly that any zero-latency IRQ must
also be declared as a direct ISR. This is critical because failure to do
so may cause race conditions between the ZLI and regular ISRs when
executing the preable/postamble code in regular interrupts.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add documentation in the timeutil group for recently added functions
for validating, comparing, and manipulating `struct timespec`
objects as well as functions for converting between representation
of time durations as either `struct timespec` or `k_timeout_t`.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Updates the scheduling documentation to include references to the
time slicing Kconfig options to make them easier to notice.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit fixes a type in kernel/driver/index.rst,
present in the "Drivers that do not use Zephyr Device
Model" subsection
Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
- Fixes Direct ISR code example.
- Deletes the wrong comment,
which was likely copy-pasted from
the previous ISR code example.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
A long time ago, Zephyr had two macros that could be used for build-time
assertions: BUILD_ASSERT() and BUILD_ASSERT_MSG(). The latter has been
dropped in v2.7 and removed from the documentation; however, the intro
paragraph of the "Build Assertions" section has never been updated to
reflect this, and still confusingly claims that "Zephyr provides two
macros for performing build-time assertions" when only BUILD_ASSERT()
remains.
Update the introductory paragraph of "Build Assertions" section such that
it makes sense now that only one build-time assertion macro exists.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Some projects may have needs for more than 99 priority levels, so add
a third linker input section for each obj level.
Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
Improve naming of the scheduler and call it what it is: simple. Using
'dumb' for the default scheduler algorithm in Zephyr is a bad idea.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Updates the direct ISR documentation to make it more clear that
direct ISR handlers should be declared using ISR_DIRECT_DECLARE().
Fixes#85683
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Enhance the description around reschedule points to provide more
context about the current thread's identity. This update clarifies
that changing the identity of the current thread involves switching
the CPU's execution from one thread to another.
Signed-off-by: Arrel Neumiller <rlneumiller@gmail.com>
doc: Improve context for thread identity in scheduling
Enhance the description around reschedule points to provide more
context about the current thread's identity. This update clarifies
that changing the identity of the current thread involves switching
the CPU's execution from one thread to another.
Signed-off-by: Arrel Neumiller <rlneumiller@gmail.com>
Clarify that the idle thread has priority CONFIG_NUM_PREEMPT_PRIORITIES,
not (CONFIG_NUM_PREEMPT_PRIORITIES - 1).
The idle thread priority ranges from 0 to 127 and never has a cooperative
thread priority.
Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
One might want to select the symbols to be relocated inside a file or
a library. To do this, one can use the FILTER argument of
zephyr_code_relocate which must contain a regular expression of the
section names to be selected for relocation.
The test_function_in_sram2 test case in
`tests/application_development/code_relocation` has been updated to
verify that only one function `function_in_sram()` is relocated to ram
and that the function `function_not_relocated()` is not being relocated
when using relocation filter.
Signed-off-by: Sylvain Chouleur <sylvain.chouleur@gmail.com>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
If there are pending readers, it is best to perform a single data copy
directly into their final destination buffer rather than doing one copy
into the ring buffer just to immediately copy the same data out of it.
Incidentally, this allows for supporting pipes with no ring buffer at all.
The pipe implementation being deprecated has a similar capability so better
have it here too.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit updates the k_pipe documentation to reflect the rewritten
interface.
Changes include:
* Detailed explanations of k_pipe concepts, initialization, and usage.
* Examples for defining, writing to, reading from, flushing,
and closing a pipe.
* Clarified behavior in edge cases and introduced enhanced error-handling
details.
Updated suggested use cases and API references.
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").
This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.
The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.
Hence this revert.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Expands the caching documentation to include a high-level overview
of caching strategies and the features available in Zephyr.
Signed-off-by: Dane Wagner <dane.wagner@gmail.com>
The initial proposal had the assert included, however this could break
downstream users and it was opted to not add assert in the driver API
calls.
Update the documented example to reflect that.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add a migration entry for the device driver API change, and start listing
driver classes that have been updated in-tree.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Update the device driver API documentation with the new DEVICE_API
macro definitions and how to use them.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This adds a new kconfig for eviction algorithm which needs page
tracking. When enabled, k_mem_paging_eviction_add()/_remove()
and k_mem_paging_eviction_accessed() must be implemented.
If an algorithm does not do page tracking, there is no need to
implement these functions, and no need for the kernel MMU code
to call into empty functions. This should save a few function
calls and some CPU cycles.
Note that arm64 unconditionally calls those functions so
forces CONFIG_EVICTION_TRACKING to be enabled there.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add support for realloc (and realloc_aligned) into the multi heap lib,
where the buffer sent in will either be reused (maybe shrinked),
or enlarged by allocating on any of the matching heaps of the multi heap.
Signed-off-by: Meir Komet <mskomet1@gmail.com>
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>
Up until now, the `__thread` keyword has been used for declaring
variables as Thread local storage. However, `__thread` is a GNU
specific keyword which thus limits compatibility with other
toolchains (for instance IAR).
This PR intoduces a new macro `Z_THREAD_LOCAL` which expands to the
corresponding C11, C23 or C++11 standard keyword based on the standard
that is specified during compilation, else it uses the old `__thread`
keyword.
Signed-off-by: Daniel Flodin <daniel.flodin@iar.com>
Fixes bad usage of single backticks in lieu of double backticks for
rendering inline literals, or simple '*' for italics.
When appropriate, a better construct than double backticks has been
selected (ex. :file:, :kconfig:option:, :c:func:, ...), or proper :ref:
have been used if the original intention was to have a link.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Dangling hyphens at the end of a line are usually a problem, ie. you
have an "hyphenated-word" and breaking it on two line will render it as
"hyphenated- word".
This commit fixes the few occurences of such dangling hyphens.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
This sets initial unpaged mappings for __ondemand_func code and
__ondemand_rodata variables. To achieve this, we have to augment the
backing store API.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Fix `k_poll()` loop example by using separate `if` blocks instead of
`if`-`else`-chain to ensure all events are handled, even if multiple are
active at the same time.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
Add information about main(int, argc **) in places where the documentation
stated that only parameterless main could be used
Signed-off-by: Jakub Michalski <jmichalski@internships.antmicro.com>
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
Describe the samples using code-sample directive in preparation for
upcoming changes to the Zephyr documentation that will be leveraging
the provided description and metadata.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
The docs for the iterable sections has a minor typo when
describing how to add the structs to the linker, repeating
'place the' twice.
Signed-off-by: Paulo Santos <pauloroberto.santos@edge.ufal.br>
Utilize a code spell-checking tool to scan for and correct spelling errors
in various files within the `doc` directory.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Adds a section providing additional information about IPI cascades
to the kernel's SMP documentation.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Also any demand paging and page frame related bits are
renamed.
This is part of a series to move memory management related
stuff out of the Z_ namespace into its own namespace.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is part of a series to move memory management related
stuff from Z_ namespace into its own namespace.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>