MOS Source Code
Loading...
Searching...
No Matches
clocksource.hpp
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.hpp>
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
clocksource_t * active_clocksource
void clocksource_register(clocksource_t *clocksource)
void clocksource_tick(clocksource_t *clocksource)
list_node_t list_head
A linked list head.
Definition list.hpp:23
const char *const name
unsigned long long u64
Definition types.h:19