MOS Source Code
Loading...
Searching...
No Matches
clocksource.c
Go to the documentation of this file.
1
// SPDX-License-Identifier: GPL-3.0-or-later
2
3
#include "
mos/device/clocksource.h
"
4
5
#include "
mos/device/timer.h
"
6
7
list_head
clocksources
=
LIST_HEAD_INIT
(
clocksources
);
8
clocksource_t
*
active_clocksource
;
9
10
void
clocksource_register
(
clocksource_t
*clocksource)
11
{
12
clocksource->
ticks
= 0;
13
list_node_append
(&
clocksources
,
list_node
(clocksource));
14
active_clocksource
= clocksource;
15
}
16
17
void
clocksource_tick
(
clocksource_t
*clocksource)
18
{
19
clocksource->
ticks
++;
20
timer_tick
();
21
}
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
clocksource.h
LIST_HEAD_INIT
#define LIST_HEAD_INIT(container)
Definition
list.h:38
list_node_append
MOSAPI void list_node_append(list_node_t *head, list_node_t *item)
Definition
list.c:68
list_node
#define list_node(element)
Get the ‘list_node’ of a list element. This is exactly the reverse of ‘list_entry’ above.
Definition
list.h:68
list_head
list_node_t list_head
A linked list head.
Definition
list.h:23
clocksource_t
Definition
clocksource.h:9
clocksource_t::ticks
u64 ticks
Definition
clocksource.h:12
timer_tick
void timer_tick()
Definition
timer.c:25
timer.h
kernel
device
clocksource.c
Generated on Sun Sep 1 2024 18:22:52 for MOS Source Code by
1.12.0