kernel: Fixes sys_clock_tick_get()
Fixes an issue in sys_clock_tick_get() that could lead to drift in
a k_timer handler. The handler is invoked in the timer ISR as a
callback in sys_tick_announce().
1. The handler invokes k_uptime_ticks().
2. k_uptime_ticks() invokes sys_clock_tick_get().
3. sys_clock_tick_get() must call elapsed() and not
sys_clock_elapsed() as we do not want to count any
unannounced ticks that may have elapsed while
processing the timer ISR.
Fixes #46378
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
parent
8e55e59c59
commit
71ef669ea4
1 changed files with 1 additions and 1 deletions
|
|
@ -289,7 +289,7 @@ int64_t sys_clock_tick_get(void)
|
|||
uint64_t t = 0U;
|
||||
|
||||
LOCKED(&timeout_lock) {
|
||||
t = curr_tick + sys_clock_elapsed();
|
||||
t = curr_tick + elapsed();
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue