diff options
author | nthnluu <nate1299@me.com> | 2024-01-28 21:20:27 -0500 |
---|---|---|
committer | nthnluu <nate1299@me.com> | 2024-01-28 21:20:27 -0500 |
commit | c63f340d90800895f007de64b7d2d14624263331 (patch) | |
tree | 2c0849fa597dd6da831c8707b6f2603403778d7b /kernel/include/util/timer.h |
Created student weenix repository
Diffstat (limited to 'kernel/include/util/timer.h')
-rw-r--r-- | kernel/include/util/timer.h | 28 |
1 files changed, 28 insertions, 0 deletions
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 |