MOS Source Code
Loading...
Searching...
No Matches
clocksource.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
6#include <mos/types.h>
7
8typedef struct clocksource
9{
11 const char *const name;
12 u64 ticks; // number of ticks since boot
13 u64 frequency; // ticks per second
15
18#define active_clocksource_ticks() READ_ONCE(active_clocksource->ticks)
19
20void clocksource_register(clocksource_t *clocksource);
21
22void clocksource_tick(clocksource_t *clocksource); // called by the timer interrupt handler
list_head clocksources
Definition clocksource.c:7
void clocksource_register(clocksource_t *clocksource)
Definition clocksource.c:10
clocksource_t * active_clocksource
Definition clocksource.c:8
void clocksource_tick(clocksource_t *clocksource)
Definition clocksource.c:17
list_node_t list_head
A linked list head.
Definition list.h:23
const char *const name
Definition clocksource.h:11
unsigned long long u64
Definition types.h:23