Lines Matching +full:idle +full:- +full:count
4 * SPDX-License-Identifier: Apache-2.0
12 #include <cavs-idc.h>
39 #define MAX_TICKS ((MAX_CYC - CYC_PER_TICK) / CYC_PER_TICK)
77 static uint64_t count(void) in count() function
79 /* The count register is 64 bits, but we're a 32 bit CPU that in count()
111 curr = count(); in compare_isr()
112 dticks = (curr - last_count) / CYC_PER_TICK; in compare_isr()
123 if ((int64_t)(next - curr) < MIN_DELAY) { in compare_isr()
134 void sys_clock_set_timeout(int32_t ticks, bool idle) in sys_clock_set_timeout() argument
136 ARG_UNUSED(idle); in sys_clock_set_timeout()
140 ticks = CLAMP(ticks - 1, 0, (int32_t)MAX_TICKS); in sys_clock_set_timeout()
143 uint64_t curr = count(); in sys_clock_set_timeout()
148 adj = (uint32_t)(curr - last_count) + (CYC_PER_TICK - 1); in sys_clock_set_timeout()
149 if (cyc <= MAX_CYC - adj) { in sys_clock_set_timeout()
157 if (((uint32_t)next - (uint32_t)curr) < MIN_DELAY) { in sys_clock_set_timeout()
172 uint64_t ret = (count() - last_count) / CYC_PER_TICK; in sys_clock_elapsed()
185 return count(); in sys_clock_cycle_get_64()
188 /* Interrupt setup is partially-cpu-local state, so needs to be
195 int cpu = arch_curr_cpu()->id; in irq_init()
198 * (for per-core control) above the interrupt controller. in irq_init()
217 uint64_t curr = count(); in sys_clock_driver_init()