Commit graph

49 commits

Author SHA1 Message Date
Jordan Yates 07870934e3 everywhere: replace double words
Treewide search and replace on a range of double word combinations:
    * `the the`
    * `to to`
    * `if if`
    * `that that`
    * `on on`
    * `is is`
    * `from from`

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-22 05:40:22 -04:00
Peter Mitsis 11417b2b57 doc: kernel: smp: Add section about IPI cascades
Adds a section providing additional information about IPI cascades
to the kernel's SMP documentation.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-21 20:49:11 -04:00
David Schneider 0e830b3f10 doc: kernel: fix braces in code example
Add missing closing brace to `k_poll()` loop example.

Signed-off-by: David Schneider <david.schneider@chargepoint.com>
2024-06-13 16:42:04 -04:00
Benjamin Cabé 593dfe1385 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>
2024-06-07 16:48:14 +03:00
Peter Mitsis 0bcdae2c62 kernel: Add CONFIG_ARCH_HAS_DIRECTED_IPIS
Platforms that support IPIs allow them to be broadcast via the
new arch_sched_broadcast_ipi() routine (replacing arch_sched_ipi()).
Those that also allow IPIs to be directed to specific CPUs may
use arch_sched_directed_ipi() to do so.

As the kernel has the capability to track which CPUs may need an IPI
(see CONFIG_IPI_OPTIMIZE), this commit updates the signalling of
tracked IPIs to use the directed version if supported; otherwise
they continue to use the broadcast version.

Platforms that allow directed IPIs may see a significant reduction
in the number of IPI related ISRs when CONFIG_IPI_OPTIMIZE is
enabled and the number of CPUs increases.  These platforms can be
identified by the Kconfig option CONFIG_ARCH_HAS_DIRECTED_IPIS.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 22:35:54 -04:00
Peter Mitsis 46e3cfa665 doc: kernel: Fix pipes configuration option link
Updates the pipes documentation to generate a link to CONFIG_PIPES
Kconfig option description instead of merely listing the name of
this option.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-06-04 19:10:56 -04:00
Glenn Andrews b3e42feaea Documentation: Update Polling API
Changes:
1. the number of events being checked did not equal those defined
in the `events` array.
2. Use `k_poll_signal_check()` instead of accessing fields directly.
3. Use `k_poll_signal_reset()` to reset the signal instead of
accessing fields directly.

I'm assuming the examples predate `k_poll_signal_check()` and
`k_poll_signal_reset()`

Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
2024-05-07 09:32:13 +02:00
Daniel Leung 6ea749de52 arch: rename arch_start_cpu() to arch_cpu_start()
Rename arch_start_cpu() to arch_cpu_start() so it belongs to
the "cpu" namespace.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-25 09:58:35 +00:00
TaiJu Wu 1f5f0cf838 sched: Remove multi-level queue priority limit
Modified bitmask to  bitmask array, it can make multilevel queue remove
32 bit prioriry limit.

We can scan bitmask array to find which queue have ready thread.

Only need the number of queues as priority because the priority
is checked on create_thread.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2024-03-12 19:37:40 -04:00
Jason Hutchinson 650a59479c doc: kernel: services: mailboxes: remove extra '.'
removed extra period after 'k_mbox_data_get()'

Signed-off-by: Jason Hutchinson <Jason_Hutchinson@Outlook.com>
2024-02-27 19:15:27 -05:00
Håkon Amundsen 6e6f8ee846 doc: kernel: interrupts: remove concept of 'interrupt handler function'
This is an alias of ISR, which should be used instead.

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2024-02-08 09:01:50 +01:00
Radoslaw Koppel 19bb21ef6d doc: kernel: interrupts: Description of the local isr declaration
This commit adds a documentation about the new parser of the
interrupt vectors tables that is using linker to construct
the arrays with all the runtime required data.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2024-02-02 19:49:36 +01:00
Radoslaw Koppel b0c83f328c arch: sw_isr_table: Update shared interrupts structures
This commit updates the definition of z_shared_isr_table_entry
to use _isr_table_entry instead of specially created z_shared_isr_client.

Signed-off-by: Radosław Koppel <radoslaw.koppel@nordicsemi.no>
2024-02-02 19:49:36 +01:00
Ben Marsh 79bbe8f4b0 doc: kernel: Add message queue & pipe to poll docs
The polling API can be used to wait on data in a FIFO, message queue,
or pipe, but the docs were not clear that message queues and pipes
are supported.

Add to the docs to make it clear message queues and pipes
can be used with the polling API.

Signed-off-by: Ben Marsh <ben.marsh@helvar.com>
2024-02-02 13:20:00 +01:00
Pisit Sawangvonganan 512dc9ff38 doc: fix typo in multiple directories (build, hardware, kernel, project)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the doc/build, hardware, kernel, project directory.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-01-26 13:16:18 +01:00
Yong Cong Sin d07d8082c9 doc: touch-up multi-level interrupt documentation
Some very minor touch-ups for multi-level interrupt
wordings and documentations to better reflects its current
state.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-26 11:47:36 +01:00
Reto Schneider 698f3b1a58 doc: Fix sentence
Before this commit, the sentence did not make sense.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-01-08 14:06:40 -05:00
Simon Hein 47ec4359b9 doc: Clean up wrong c function links
Resolve wrong documentation c function links for
irq: z_shared_isr, rtio: rtio_cqe_get_mempool_buffer
and sensor: sensor_read

Signed-off-by: Simon Hein <Shein@baumer.com>
2023-12-15 08:51:34 -06:00
Simon Hein 64462657c9 doc: irq: fix function link
fix not correct shown function link for irq_connect_dynamic.

Signed-off-by: Simon Hein <Shein@baumer.com>
2023-12-13 20:13:46 +01:00
Børre A. Opedal Lunde 6c6712d104 doc: timers: correct grammar and typos
Minor grammatical errors and mistyped words were
corrected to improve clarity.

Signed-off-by: Børre A. Opedal Lunde <borre97@live.no>
2023-11-28 17:17:58 -05:00
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 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 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
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
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
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
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
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
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
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
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
Tomasz Moń 800ec14cd3 doc: polling: Fix semaphore contested description
If a semaphore is contested, it is possible that the semaphore will no
longer be available when k_sem_take() is called, not k_sem_give().

Fix few typos and explicitly mention poll events instead of "they".

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-10-04 10:36:45 +02:00
Stephanos Ioannidis 74e6f70a63 doc: mailboxes: Remove memory block-related details
The commit c844bd87b3 removed the support
for passing a memory block (allocated in a memory pool) as message
data, but did not update the relevant documentation.

This commit removes any references to the memory block support, which
was removed in the v2.5.0 release, in the mailbox API documentation.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-28 14:24:34 +00:00
Peter Mitsis d13a2544f7 doc: Update documentation related to pipes
The pipes implementation has been updated to allow ISRs to both
send and receive data to/from pipes provided the K_NO_WAIT timeout
option is used.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-08-17 19:31:25 +02:00
honglin leng 82e05894b7 docs: fix idle prio in cooperative mode
with cooperative mode , the idle prio should be 0

Signed-off-by: honglin leng <a909204013@gmail.com>
2022-08-09 12:28:00 +02:00
Peter Mitsis 0476d6ad69 doc: Update mutex priority inheritance description
Updates the priority inheritance description to better explain what
happens during priority inheritance and warn of the consequences of
not following best-practices.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-07-21 21:59:18 -04:00
Archie Atkinson 6cd8ef479f doc: change key properties from italic to bold
This is to keep it inline with the reset of the kernel docs

Signed-off-by: Archie Atkinson <archie.atkinson@chiaro.co.uk>
2022-06-28 16:17:32 +02:00
Stephanos Ioannidis 5cee62acd1 doc: kernel: Re-organise memory management API pages
The kernel documentation listed the memory management API pages under
two different sections: 'Kernel/Kernel Services' and
'Kernel/Memory Management' -- this creates unnecessary confusion and
makes it hard to look up all supported kernel memory management APIs.

This commit relocates the memory management API pages under
'Kernel/Kernel Services' to 'Kernel/Memory Management' so that all
memory management APIs provided by the kernel are described in one
unified section.

The link to the 'Kernel/Memory Management' index page is still left in
the 'Kernel Services' page because it may still be helpful to look at
it as part of the services provided by the Zephyr kernel -- it is just
more substantial than the rest and deserves more visibility.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-01 15:26:48 +02:00
Stephanos Ioannidis c45a2213c6 doc: develop: Add 'Language Support' sub-category
This commit adds the 'Language Support' sub-category under the
'Developing with Zephyr' category with programming language support-
related documentations.

The contents of the 'C standard library' page have been relocated to
the 'C Language Support' page, and the contents of the 'C++ Support for
Applications' page have been relocated to the 'C++ Language Support'
page.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-01 15:26:48 +02:00
Archie Atkinson 26d2c12884 doc: fixes errors pipes wiki entry
Moves the 'Flushing a Pipe' code example to the correct location
and section and re-adds the 'Suggested Uses' text missing
compared to v2.7.

Signed-off-by: Archie Atkinson <archie.atkinson@chiaro.co.uk>
2022-05-20 12:38:37 +02:00
Aleksandar Markovic 7af3b8cbb3 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>
2022-04-21 18:35:16 -04:00
Peter Mitsis 111865a8c5 doc: threads: Clarify ready/running states
Updates the threads documentation to clarify the distinction between
ready and running states.

Fixes 44255

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-04-20 10:25:59 -04:00
Anas Nashif 38635f8899 doc: move kernel services under kernel
Move all kernel documentation under kernel/services.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-07 16:35:19 +02:00