From c63f340d90800895f007de64b7d2d14624263331 Mon Sep 17 00:00:00 2001 From: nthnluu Date: Sun, 28 Jan 2024 21:20:27 -0500 Subject: Created student weenix repository --- kernel/include/util/timer.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 kernel/include/util/timer.h (limited to 'kernel/include/util/timer.h') diff --git a/kernel/include/util/timer.h b/kernel/include/util/timer.h new file mode 100644 index 0000000..57889f9 --- /dev/null +++ b/kernel/include/util/timer.h @@ -0,0 +1,28 @@ +#ifndef TIMER_H +#define TIMER_H + +#include "util/list.h" + +typedef struct timer +{ + void (*function)(uint64_t data); + uint64_t data; + uint64_t expires; + list_link_t link; +} timer_t; + +void timer_init(timer_t *timer); + +void timer_add(timer_t *timer); + +int timer_del(timer_t *timer); + +int timer_mod(timer_t *timer, int expires); + +int timer_pending(timer_t *timer); + +int timer_del_sync(timer_t *timer); + +void __timers_fire(); + +#endif \ No newline at end of file -- cgit v1.2.3-70-g09d2