1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#include "mos/device/clocksource.h"
4
5#include "mos/device/timer.h"
6
7list_head clocksources = LIST_HEAD_INIT(clocksources);
8clocksource_t *active_clocksource;
9
10void clocksource_register(clocksource_t *clocksource)
11{
12 clocksource->ticks = 0;
13 list_node_append(head: &clocksources, list_node(clocksource));
14 active_clocksource = clocksource;
15}
16
17void clocksource_tick(clocksource_t *clocksource)
18{
19 clocksource->ticks++;
20 timer_tick();
21}
22