Lines Matching +full:- +full:t

4  * SPDX-License-Identifier: Apache-2.0
24 /* Ticks left to process in the currently-executing sys_clock_announce() */
41 sys_dnode_t *t = sys_dlist_peek_head(&timeout_list); in first() local
43 return (t == NULL) ? NULL : CONTAINER_OF(t, struct _timeout, node); in first()
46 static struct _timeout *next(struct _timeout *t) in next() argument
48 sys_dnode_t *n = sys_dlist_peek_next(&timeout_list, &t->node); in next()
53 static void remove_timeout(struct _timeout *t) in remove_timeout() argument
55 if (next(t) != NULL) { in remove_timeout()
56 next(t)->dticks += t->dticks; in remove_timeout()
59 sys_dlist_remove(&t->node); in remove_timeout()
70 * will be scheduled at well-defined offsets from the currently firing in elapsed()
77 * will be non-zero while sys_clock_announce() is executing and zero in elapsed()
90 ((int64_t)(to->dticks - ticks_elapsed) > (int64_t)INT_MAX)) { in next_timeout()
93 ret = MAX(0, to->dticks - ticks_elapsed); in next_timeout()
110 __ASSERT(!sys_dnode_is_linked(&to->node), ""); in z_add_timeout()
111 to->fn = fn; in z_add_timeout()
114 struct _timeout *t; in z_add_timeout() local
118 k_ticks_t ticks = Z_TICK_ABS(timeout.ticks) - curr_tick; in z_add_timeout()
120 to->dticks = MAX(1, ticks); in z_add_timeout()
122 to->dticks = timeout.ticks + 1 + elapsed(); in z_add_timeout()
125 for (t = first(); t != NULL; t = next(t)) { in z_add_timeout()
126 if (t->dticks > to->dticks) { in z_add_timeout()
127 t->dticks -= to->dticks; in z_add_timeout()
128 sys_dlist_insert(&t->node, &to->node); in z_add_timeout()
131 to->dticks -= t->dticks; in z_add_timeout()
134 if (t == NULL) { in z_add_timeout()
135 sys_dlist_append(&timeout_list, &to->node); in z_add_timeout()
146 int ret = -EINVAL; in z_abort_timeout()
149 if (sys_dnode_is_linked(&to->node)) { in z_abort_timeout()
163 for (struct _timeout *t = first(); t != NULL; t = next(t)) { in timeout_rem() local
164 ticks += t->dticks; in timeout_rem()
165 if (timeout == t) { in timeout_rem()
179 ticks = timeout_rem(timeout) - elapsed(); in z_timeout_remaining()
215 * systems someone might be already running the loop. Don't in sys_clock_announce()
228 struct _timeout *t; in sys_clock_announce() local
230 for (t = first(); in sys_clock_announce()
231 (t != NULL) && (t->dticks <= announce_remaining); in sys_clock_announce()
232 t = first()) { in sys_clock_announce()
233 int dt = t->dticks; in sys_clock_announce()
236 t->dticks = 0; in sys_clock_announce()
237 remove_timeout(t); in sys_clock_announce()
240 t->fn(t); in sys_clock_announce()
242 announce_remaining -= dt; in sys_clock_announce()
245 if (t != NULL) { in sys_clock_announce()
246 t->dticks -= announce_remaining; in sys_clock_announce()
263 uint64_t t = 0U; in sys_clock_tick_get() local
266 t = curr_tick + elapsed(); in sys_clock_tick_get()
268 return t; in sys_clock_tick_get()
326 remaining = (timepoint.tick > now) ? (timepoint.tick - now) : 0; in sys_timepoint_timeout()