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
5
#include <
mos/lib/structures/list.h
>
6
#include <
mos/types.h
>
7
8
typedef
struct
clocksource
9
{
10
as_linked_list
;
11
const
char
*
const
name
;
12
u64
ticks
;
// number of ticks since boot
13
u64
frequency
;
// ticks per second
14
}
clocksource_t
;
15
16
extern
list_head
clocksources
;
17
extern
clocksource_t
*
active_clocksource
;
18
#define active_clocksource_ticks() READ_ONCE(active_clocksource->ticks)
19
20
void
clocksource_register
(
clocksource_t
*clocksource);
21
22
void
clocksource_tick
(
clocksource_t
*clocksource);
// called by the timer interrupt handler
clocksources
list_head clocksources
Definition
clocksource.c:7
clocksource_register
void clocksource_register(clocksource_t *clocksource)
Definition
clocksource.c:10
active_clocksource
clocksource_t * active_clocksource
Definition
clocksource.c:8
clocksource_tick
void clocksource_tick(clocksource_t *clocksource)
Definition
clocksource.c:17
list_head
list_node_t list_head
A linked list head.
Definition
list.h:23
list.h
clocksource_t
Definition
clocksource.h:9
clocksource_t::ticks
u64 ticks
Definition
clocksource.h:12
clocksource_t::as_linked_list
as_linked_list
Definition
clocksource.h:10
clocksource_t::name
const char *const name
Definition
clocksource.h:11
clocksource_t::frequency
u64 frequency
Definition
clocksource.h:13
types.h
u64
unsigned long long u64
Definition
types.h:23
kernel
include
private
mos
device
clocksource.h
Generated on Sun Sep 1 2024 18:22:52 for MOS Source Code by
1.12.0