kernel/sched: correct k_sleep() return value calculation
Fix the issue: https://github.com/zephyrproject-rtos/zephyr/issues/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
Please sign in to comment