zephyr/doc/kernel
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
..
data_structures doc: Fix kernel data structures typos 2022-10-10 21:01:51 -04:00
drivers fix: doc: in kernel/drivers interrupts function had mismatching types 2023-02-22 16:58:29 -05:00
iterable_sections doc: move misc services into OS Service section 2022-04-07 16:35:19 +02:00
memory_management doc: kernel: Re-organise memory management API pages 2022-06-01 15:26:48 +02:00
services kernel/timeout: introduce the timepoint API 2023-07-25 09:12:26 +02:00
timing_functions include: update documentation to use zephyr/ prefix 2022-04-21 07:40:54 -05:00
usermode doc: kernel/syscalls: about limiting syscalls in binaries 2023-06-17 07:57:45 -04:00
util
code-relocation.rst doc: kernel: code-relocation: Remove erroneous note 2023-07-10 10:01:42 +00:00
index.rst doc: develop: Add 'Language Support' sub-category 2022-06-01 15:26:48 +02:00
timeutil.rst doc: move timeutil to kernel 2022-04-07 16:35:19 +02:00