zephyr/lib
Ederson de Souza d83a649a67 lib/posix: Get uptime in ticks instead of cycles
__z_clock_nanosleep function was getting current time in cycles, via
k_cycle_get_32(), to perform its time calculations. However, when calling
k_sleep() to actually sleep, times are measured in ticks.

This causes a problem when there's a big skew between the uptime
measured in cycles vs uptime measured in ticks: in some platforms, the
system clock maybe up for a long time already when Zephyr starts
counting ticks, for instance, while downloading an image via PXE. In
this case, the calculations done inside __z_clock_nanosleep end up
measuring a much bigger current time than expected, thus sleeping too
much, basically all the time since system clock initialization.

This patch fixes that by avoiding the cycle trip: stick to ticks,
instead. They start counting from Zephyr initialization instead, which
is the expected uptime.

Fixes #69608

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-06-28 21:01:54 -04:00
..
acpi
cpp lib c/cpp: Move .ctor .init_array handling from C++ to kernel 2024-06-25 19:14:37 -04:00
crc lib: avoided increments/decrements with side effects 2024-06-21 08:48:15 -04:00
hash
heap lib: added blanks between operators 2024-06-13 20:28:23 -04:00
libc posix: add stubs for signal.h functions that need process support 2024-06-27 15:16:50 -04:00
mem_blocks
open-amp driver: ram_console: leave one byte from the defined buffer size 2024-06-12 17:09:24 -05:00
os ARCMWDT: Fix cbprintf issue with omitted function prototype 2024-06-28 07:21:11 -04:00
posix lib/posix: Get uptime in ticks instead of cycles 2024-06-28 21:01:54 -04:00
runtime
smf Lib: SMF: fix stuck handled bit when transitioning 2024-06-24 14:50:00 -04:00
utils zephyr: Add zero-len check for utf8_trunc 2024-06-27 08:48:31 -04:00
CMakeLists.txt
Kconfig