Commit graph

6 commits

Author SHA1 Message Date
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
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
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
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
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