1// SPDX-License-Identifier: GPL-3.0-or-later
2
3#pragma once
4
5#include "mos/lib/structures/list.h"
6#include "mos/platform/platform.h"
7
8typedef struct _ktimer ktimer_t;
9
10typedef bool (*timer_callback_t)(ktimer_t *timer, void *arg);
11
12typedef struct _ktimer
13{
14 as_linked_list;
15 u64 timeout;
16 thread_t *thread;
17 bool ticked;
18 timer_callback_t callback;
19 void *arg;
20} ktimer_t;
21
22void timer_tick(void);
23
24long timer_msleep(u64 ms);
25