summaryrefslogtreecommitdiff
path: root/kc/core/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'kc/core/timer.h')
-rw-r--r--kc/core/timer.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/kc/core/timer.h b/kc/core/timer.h
index 6960a4b..b41aa35 100644
--- a/kc/core/timer.h
+++ b/kc/core/timer.h
@@ -5,6 +5,14 @@
#define TIMER_MICROSECOND 1000000ULL
#define TIMER_NANOSECOND 1000000000ULL
+typedef int (*timer_callback)(uint64_t nanoseconds);
+
+struct timer_callback_list
+{
+ timer_callback func;
+ struct timer_callback_list *next;
+};
+
struct timer_source
{
const char *name;
@@ -15,6 +23,9 @@ struct timer_source
void (*set_frequency)(uint32_t frequency);
uint32_t (*get_frequency)(void);
+ int (*append_callback)(timer_callback func);
+ void (*delete_callback)(timer_callback func);
+
uint64_t (*nanoseconds_elapsed)(void);
uint64_t (*nanoseconds_delta)(void);
};