regression: test serial port r/w.
[lunaix-os.git] / lunaix-os / includes / hal / hwtimer.h
index efa72d8f2d995ce16f2c286648332281f43929dd..83ff92c8bc9c3bc75162edb913009071db437ebf 100644 (file)
@@ -1,27 +1,32 @@
 #ifndef __LUNAIX_HWTIMER_H
 #define __LUNAIX_HWTIMER_H
 
+#include <lunaix/device.h>
 #include <lunaix/time.h>
 #include <lunaix/types.h>
 
 typedef void (*timer_tick_cb)();
 
-struct hwtimer_context
+struct hwtimer
 {
     char* name;
     void* data;
 
-    int (*supported)(struct hwtimer_context*);
-    void (*init)(struct hwtimer_context*, u32_t hertz, timer_tick_cb);
+    struct device* timer_dev;
+
+    int (*supported)(struct hwtimer*);
+    void (*init)(struct hwtimer*, u32_t hertz, timer_tick_cb);
     ticks_t (*systicks)();
     ticks_t base_freq;
     ticks_t running_freq;
 };
 
+extern struct hwtimer* current_timer;
+
 void
 hwtimer_init(u32_t hertz, void* tick_callback);
 
-struct hwtimer_context*
+struct hwtimer*
 hwtimer_choose();
 
 ticks_t