kernel: Remove CONFIG_LEGACY_TIMEOUT_API

This was a fallback for an API change several versions ago.  It's time
for it to go.

Fixes: #30893

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2020-12-18 11:12:39 -08:00 committed by Anas Nashif
commit e956639dd6
14 changed files with 6 additions and 129 deletions

View file

@ -248,38 +248,6 @@ value passed to :c:func:`z_clock_set_timeout` may be clamped to a
smaller value than the current next timeout when a time sliced thread
is currently scheduled.
Legacy Usage and Porting Guide
==============================
In earlier versions of Zephyr, the :c:type:`k_timeout_t` abstraction
did not exist and timeouts were presented to the kernel as signed
integer values specified in milliseconds. The :c:macro:`K_FOREVER`
value was defined with a value of -1.
In general, application code that uses the pre-existing constructor
macros (:c:macro:`K_MSEC()` et. al.) will continue to work without
change. Code that presents raw milliseconds to the calls can simply
wrap the argument in :c:macro:`K_MSEC()`.
Some Zephyr subsystem code, however, was written originally to present
their own APIs to the user which accept millisecond values (including
:c:macro:`K_FOREVER`) and take actions like storing the value for
later, or performing arithmetic on the value. This will no longer
work unmodified in the new scheme.
One option in the immediate term is to use the
:c:option:`CONFIG_LEGACY_TIMEOUT_API` kconfig. This redefines the
:c:type:`k_timeout_t` type to be a 32 bit integer and preserves source
code compatibility with the older APIs. This comes at the cost of
disabling newer features like absolute timeouts and 64 bit precision.
This kconfig exists for application code, however, and will be going
away in a forthcoming release.
A better scheme is to port the subsystem to the new timeout scheme
directly. There are two broad architectures for doing this: using
:cpp:type:`k_timeout_t` naturally as an application API, or preserving the
millisecond subsystem API and converting internally.
Subsystems that keep millisecond APIs
-------------------------------------