Lines Matching +full:initial +full:- +full:key
2 * Copyright (c) 2014-2015 Wind River Systems, Inc.
5 * SPDX-License-Identifier: Apache-2.0
51 #define MAX_TICKS ((COUNTER_MAX / CYC_PER_TICK) - 1)
168 * - reprogramming of LIMIT must be clearing the COUNT
169 * - ISR must be clearing the 'overflow_cycles' counter.
170 * - no more than one counter-wrap has occurred between
171 * - the timer reset or the last time the function was called
172 * - and until the current call of the function is completed.
173 * - the function is invoked with interrupts disabled.
218 k_spinlock_key_t key; in timer_int_handler() local
223 key = k_spin_lock(&lock); in timer_int_handler()
227 dticks = (curr_time - last_time) / CYC_PER_TICK; in timer_int_handler()
231 k_spin_unlock(&lock, key); in timer_int_handler()
242 uint32_t key; in timer_int_handler() local
244 key = arch_irq_lock(); in timer_int_handler()
250 arch_irq_unlock(key); in timer_int_handler()
252 dticks = (cycle_count - announced_cycles) / CYC_PER_TICK; in timer_int_handler()
266 /* as 64-bits GFRC is used as wall clock, it's ok to ignore idle in sys_clock_set_timeout()
268 * However for single core using 32-bits arc timer, idle cannot in sys_clock_set_timeout()
269 * be ignored, as 32-bits timer will overflow in a not-long time. in sys_clock_set_timeout()
280 uint32_t key; in sys_clock_set_timeout() local
291 key = arch_irq_lock(); in sys_clock_set_timeout()
293 timer0_limit_register_set(delay - 1); in sys_clock_set_timeout()
298 arch_irq_unlock(key); in sys_clock_set_timeout()
313 ticks = MIN(MAX_TICKS, (uint32_t)(MAX((int32_t)(ticks - 1), 0))); in sys_clock_set_timeout()
315 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_set_timeout()
328 unannounced = cycle_count - announced_cycles; in sys_clock_set_timeout()
331 /* We haven't announced for more than half the 32-bit in sys_clock_set_timeout()
346 delay -= unannounced; in sys_clock_set_timeout()
352 timer0_limit_register_set(last_load - 1); in sys_clock_set_timeout()
355 k_spin_unlock(&lock, key); in sys_clock_set_timeout()
367 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_elapsed() local
370 cyc = (z_arc_connect_gfrc_read() - last_time); in sys_clock_elapsed()
372 cyc = elapsed() + cycle_count - announced_cycles; in sys_clock_elapsed()
375 k_spin_unlock(&lock, key); in sys_clock_elapsed()
383 return z_arc_connect_gfrc_read() - start_time; in sys_clock_cycle_get_32()
385 k_spinlock_key_t key = k_spin_lock(&lock); in sys_clock_cycle_get_32()
388 k_spin_unlock(&lock, key); in sys_clock_cycle_get_32()
396 /* set the initial status of timer0 of each slave core in smp_timer_init()
426 timer0_limit_register_set(CYC_PER_TICK - 1); in sys_clock_driver_init()
437 timer0_limit_register_set(last_load - 1); in sys_clock_driver_init()