Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / lwk / timer.h
1 #ifndef _LWK_TIMER_H
2 #define _LWK_TIMER_H
3
4 #include <lwk/idspace.h>
5 #include <lwk/list.h>
6
7 /**
8  * This structure defines a timer, including when the timer should expire
9  * and the callback function to call when it expires. The callback function
10  * runs in interrupt context with interrupts disabled.
11  */
12 struct timer {
13         struct list_head link;
14         id_t             cpu;            /* CPU this timer is installed on */
15         uint64_t         expires;        /* Time when this timer expires */
16         uintptr_t        data;           /* arg to pass to function */
17         void (*function)(uintptr_t);     /* executed when timer expires */
18 };
19
20 /**
21  * Core timer API.
22  */
23 void timer_add(struct timer *timer);
24 void timer_del(struct timer *timer);
25 uint64_t timer_sleep_until(uint64_t when);
26
27 /**
28  * Internal timer-subsystem functions.
29  * Normal kernel code and drivers should not call these.
30  */
31 int timer_subsys_init(void);
32 void expire_timers(void);
33 void schedule_next_wakeup(void);
34
35 /**
36  * Architecture-dependent timer functions.
37  */
38 void arch_schedule_next_wakeup(uint64_t when);
39
40 #endif