Commit graph

367 commits

Author SHA1 Message Date
Benjamin Cabé 155420522b doc: Fix occurrences of repeated words
Another round of repeated words cleanup. This commit tries to keep the
diff minimal and line wrapping was mostly left intact in the touched
files, as having them consistent across the documentation is probably
the topic of a future tree-wide cleanup (or not)

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-15 17:34:39 -05:00
Andrej Butok 287b30eb78 doc: Fix double 'the'
Fix double 'the' in all .rst documentation.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-15 14:25:11 +00:00
Andrej Butok 2e97e5daa8 doc: mpsc: Add missed 'end'
Adds missed 'end' in the 'Internals' chapter.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-15 10:05:27 +01:00
Thien Nguyen a0b746ed74 doc: drivers: deprecate driver init levels
Remove deprecated driver initialization levels in the docs.

Signed-off-by: Thien Nguyen <nguyenmthien@live.com>
2023-11-14 10:20:53 -05:00
Andrej Butok 583fd8a79e 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>
2023-11-08 10:10:27 +01:00
Andrej Butok 5730dd6fb7 doc: fix typos
Add missed "space".
Add missed "been".

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-08 10:09:44 +01:00
Andrej Butok 95a5f5178f doc: memory: Fix SYS_MEM_BLOCKS_DEFINE_STATIC description
Fix SYS_MEM_BLOCKS_DEFINE_STATIC() description.
Use a "memory blocks allocator" instead of "slab",
which is most probably was copy-pasted from
the previous "slab" chapter by mistake.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-06 19:03:29 -05:00
Anas Nashif a08bfeb49c syscall: rename Z_OOPS -> K_OOPS
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif ee9f278323 syscall: rename Z_SYSCALL_VERIFY -> K_SYSCALL_VERIFY
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif 1a9de05767 syscall: rename Z_SYSCALL_DRIVER_ -> K_SYSCALL_DRIVER_
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif 9c4d881183 syscall: rename Z_SYSCALL_ to K_SYSCALL_
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif 9c1aeb5fd3 syscall: rename z_user_ to k_usermode_
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif 56fddd805a syscall: rename z_user_from_copy -> k_usermode_from_copy
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif 21254b2f40 syscall: rename z_object_validate -> k_object_validate
Rename internal API to not use z_/Z_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif df9428991a syscall: Z_SYSCALL_MEMORY_ARRAY -> K_SYSCALL_MEMORY_ARRAY
Rename macros and do not use Z_ for internal APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif 684b8fcdd0 syscall: Z_SYSCALL_VERIFY_MSG -> K_SYSCALL_VERIFY_MSG
Rename macros and do not use Z_ for internal APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif 4e396174ce kernel: move syscall_handler.h to internal include directory
Move the syscall_handler.h header, used internally only to a dedicated
internal folder that should not be used outside of Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Anas Nashif c91cad735a kernel: object: rename z_object_init to k_object_init
Do not use z_ for internal API and rename to k_object_init.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-11-03 11:46:52 +01:00
Fabio Baltieri bc43e890fd doc: drivers: add a paragraph mentioning the initlevels target
Add a paragraph mentioning the initlevels target for inspecting the
DEVICE_DEFINE and SYS_INIT sequence.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-28 23:19:59 +02:00
Andrej Butok 3fab7624eb doc: pipes: Fix the pipe read example.
Replaces sizeof(header) which is equal to the size of the pointer,
by sizeof (*header), which is equal to the size of struct message_header.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-10-26 10:29:37 -04:00
Benjamin Cabé 32918ddd92 doc: Fix broken references to Kconfig options
Fixed a few occurrences of incorrect references to Kconfig options
(missing the CONFIG_ prefix)

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-17 19:50:39 +01:00
Andrei Hutanu 9fcc609237 docs: mem: slabs: fix for mem_slab docs snippets
Attempting to run the memory slab docs snippets will
result in build issues. This PR is an attempt to fix
those.

Signed-off-by: Andrei Hutanu <andrei.hutanu.i@gmail.com>
2023-10-17 13:17:56 +03:00
Benjamin Cabé 8ec1a27920 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>
2023-10-14 18:42:34 +03:00
Peter Mitsis e9987aabbc kernel: Remove legacy mem block from mailbox
Memory blocks are a legacy feature and are to be removed from
mailboxes.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-13 09:56:02 +03:00
Daniel Leung 04a0cf7d79 kernel: deprecate K_THREAD_STACK_MEMBER
The macro K_THREAD_STACK_MEMBER has actually been deprecated
since v2.4.0 in the macro doxygen description, but it was
never marked with __DEPRECATED_MACRO. Since this was being
used in various drivers, make it follow the deprecation
process.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-12 11:07:00 +01:00
Marcin Gasiorek 47822586e4 doc: Remove two redundant characters in rst file
Remove additional dot and bracket.

Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
2023-10-11 11:10:05 +02:00
Peter Mitsis d66cf91706 doc: Add missing threads references to object cores
Two references to the integration of object cores with threads were
missing from the documentation. This fixes that.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-09 10:16:46 +02:00
Flavio Ceolin 15aa3acaf6 kconfig: Remove MP_NUM_CPUS usage
Zephyr's code base uses MP_MAX_NUM_CPUS to
know how many cores exists in the target. It is
also expected that both symbols MP_MAX_NUM_CPUS
and MP_NUM_CPUS have the same value, so lets
just use MP_MAX_NUM_CPUS and simplify it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-03 17:45:53 +01:00
Peter Mitsis 1afc32e762 doc: Add object core documentation
Adds documentation for both object cores and object core statistics.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-09-30 08:04:14 +03:00
Grant Ramsay a8497c5216 kernel: msg_q: Remove alignment requirements from message queue docs
Alignment of the message queue's ring buffer is not necessary.
The underlying implementation uses memcpy (which is
alignment-agnostic) and does not expose any internal pointers

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-09-28 16:14:56 +02:00
Laurentiu Mihalcea b1111d9de4 doc: interrupts: Document support for shared interrupts
This commit adds the documentation for shared interrupts.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-09-14 08:35:12 +02:00
Huifeng Zhang 2c22e83dfb include: arch: arm: Remove aarch32 directory
This commit follows the parent commit work.

This commit introduces the following major changes.

  1. Move all directories and files in 'include/zephyr/arch/arm/aarch32'
    to the 'include/zephyr/arch/arm' directory.

  2. Change the path string which is influenced by the changement 1.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-09-13 10:08:05 +01:00
Carles Cufi 8c748fd005 kernel: Modify the signature of k_mem_slab_free()
Modify the signature of the k_mem_slab_free() function with a new one,
replacing the old void **mem with void *mem as a parameter.

The following function:
void k_mem_slab_free(struct k_mem_slab *slab, void **mem);

has the wrong signature. mem is only used as a regular pointer, so there
is no need to use a double-pointer. The correct signature should be:
void k_mem_slab_free(struct k_mem_slab *slab, void *mem);

The issue with the current signature, although functional, is that it is
extremely confusing. I myself, a veteran Zephyr developer, was confused
by this parameter when looking at it recently.

All in-tree uses of the function have been adapted.

Fixes #61888.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-09-03 18:20:59 -04:00
Joshua Lilly cce530cae4 scripts: build: gen_isr_tables: make bit masks configurable
Some architectures such as RISC-v support more than 255 interrupts
per aggrigator. This diff adds the ability to forgo the aggrigator
pattern and use a configurable number of bits for multilevel
interruts.

Signed-off-by: Joshua Lilly <jgl@meta.com>
2023-08-10 10:55:41 -04:00
Nicolas Pitre 52e2f83185 kernel/timeout: introduce the timepoint API
This is meant as a substitute for sys_clock_timeout_end_calc()

Current sys_clock_timeout_end_calc() usage opens up many bug
possibilities due to the actual timeout evaluation's open-coded nature.

Issue ##50611 is one example.

- Some users store the returned value in a signed variable, others in
  an unsigned one, making the comparison with UINT64_MAX (corresponding
  to K_FOREVER) wrong in the signed case.

- Some users compute the difference and store that in a signed variable
  to compare against 0 which still doesn't work with K_FOREVER. And when
  this difference is used as a timeout argument then the K_FOREVER
  nature of the timeout is lost.

- Some users complexify their code by special-casing K_NO_WAIT and
  K_FOREVER inline which is bad for both code readability and binary
  size.

Let's introduce a better abstraction to deal with absolute timepoints
with an opaque type to be used with a well-defined API.
The word "timeout" was avoided in the naming on purpose as the timeout
namespace is quite crowded already and it is preferable to make a
distinction between relative time periods (timeouts) and absolute time
values (timepoints).

A few stacks are also adjusted as they were too tight on X86.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-07-25 09:12:26 +02:00
Jamie McCrae d98656f081 doc: kernel: code-relocation: Remove erroneous note
The note about required position for the function is not valid.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-10 10:01:42 +00:00
Florian Grandel 5fa5534afc doc: kernel: clocks: define "current time"
Scheduling relative timeouts from within timer callbacks (=sys clock ISR
context) differs from scheduling relative timeouts from an application
context.

This change documents and explains the rationale of this distinction.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-06-30 16:07:26 +02:00
Anas Nashif d6ce537be8 doc: kernel: update thread priorities diagram
cooperative priorities are negative, 0 is not a cooperative priority.
Looks like the docs are showing an outdated diagram for some reason, try
to update that with a refresh.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-23 14:27:22 -04:00
Peter Mitsis 4c7aeb252d doc: Correct msgq data item size discrepancy
Updates the data passing summary table to indicate that the size of
a message queue data item must be a multiple of its data alignment.
This brings the documentation in both the summary table and the
message queue documentation into alignment.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-06-21 13:57:15 -04:00
Daniel Leung dbeb4d8f48 doc: kernel/syscalls: about limiting syscalls in binaries
Since not all syscalls are generated to be included in
the final binaries due to changes in build steps and CMake
files, update the document to clarify what needs to be
done to include specific syscalls in final binaries.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-06-17 07:57:45 -04:00
Peter Mitsis 2adfa3e1ae doc: Update FIFO and LIFO documentation
Updates the FIFO and LIFO documentation to clarify behavior
surrounding re-adding data items to queues.

Fixes #56336

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-05-02 04:43:08 -04:00
Anas Nashif 5238544d30 doc: change path to code relocation test
A sample was moved to tests, adapt documentation accordingly.

Fixes #56962

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-19 10:42:37 -04:00
Keith Packard 3a197934fc doc: Switch main return type from void to int.
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Sophie Tyalie e3ae110a05 fix: doc: in kernel/drivers interrupts function had mismatching types
The typedef defines an interrupt config routine with `const struct device
*dev`, while the example function had (void) as argument. This could be
considered confusing / would throw compiler warnings even though the
parameter isn't strictly necessary.

Code examples for initializing an IRQ in a device example follow the
updated pattern (e.g. see `drivers/serial/uart_npcx.c`).

Signed-off-by: Sophie Tyalie <dev@flowerpot.me>
2023-02-22 16:58:29 -05:00
Nicolas Pitre 6b0586ef05 riscv: improve FPU sharing documentation
Augment the doc with functionality added in commit a211970b42 ("riscv:
improve contended FPU switching").

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-02-18 01:09:16 +09:00
Nicolas Pitre ff07da6ff1 riscv: integrate the new FPU context switching support
FPU context switching is always performed on demand through the FPU
access exception handler. Actual task switching only grants or denies
FPU access depending on the current FPU owner.

Because RISC-V doesn't have a dedicated FPU access exception, we must
catch the Illegal Instruction exception and look for actual FP opcodes.

There is no longer a need to allocate FPU storage on the stack for every
exception making esf smaller and stack overflows less likely.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-01-24 15:26:18 +01:00
Daniel DeGrasse de8478b7f3 doc: code-relocation: Update usage of zephyr_code_relocate
Update usage of zephyr_code_relocate to new API, and add examples of
relocating a library target, as well as using multiple files in list or
CMake generator expressions.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-01-17 18:08:37 +01:00
Marti Bolivar 1037348b7b doc: update stale references to boilerplate.cmake
Inclusion of this file is now deprecated in favor of
find_package(Zephyr ...). Update documentation appropriately.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-11 09:40:14 +01:00
Henrik Brix Andersen 3c99a1e015 drivers: pcie: reintroduce support for I/O BARs
Reintroduce support for accessing I/O BARs which was removed in
43d84147d9.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-11-01 15:22:31 -04:00
Tomasz Moń fa86481692 doc: Verify write access in syscall example
Use z_user_to_copy() instead of directly writing to the user provided
pointer to validate that the user has write permission to underlying
memory location.

It is important to verify the memory not only for reads, but also for
writes, as otherwise the function can be abused by usermode code to
write to privileged read/write, unprivileged read-only memory partition.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-10-14 09:56:30 +02:00