Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel/sched: correct k_sleep() return value calculation
Fix the issue: zephyrproject-rtos#79863 The expected_wakeup_ticks and sys_clock_tick_get_32() are uint32_t values, and may wrap around individually. If the expected_wakeup_ticks has a wraparound and sys_clock_tick_get_32() doesn't, so expected_wakeup_ticks < sys_clock_tick_get_32(), the API return value will be corrupted. The API return value, that is the remaining time, should be calculated in 32bit-unsigned-integer manner, and any wraparound will be treated properly. Signed-off-by: Akaiwa Wataru <akaiwa@sonas.co.jp>
- Loading branch information