/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* Timer module for Chrome EC operating system */ #include #include "task.h" #include "timer.h" #include "hwtimer.h" #include "atomic.h" #include "console.h" #include "uart.h" #include "util.h" /* high word of the 64-bit timestamp counter */ static volatile uint32_t clksrc_high; /* bitmap of currently running timers */ static uint32_t timer_running = 0; /* deadlines of all timers */ static timestamp_t timer_deadline[TASK_ID_COUNT]; static uint32_t next_deadline = 0xffffffff; /* Hardware timer routine IRQ number */ static int timer_irq; static void expire_timer(task_id_t tskid) { /* we are done with this timer */ atomic_clear(&timer_running, 1<