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.


*** empty log message ***
[palacios.releases.git] / palacios / src / devices / timer.c
1 #include <devices/timer.h>
2 #include <palacios/vmm.h>
3
4
5 #define TIMER_IRQ 32
6
7 struct timer_state {
8   int foo;
9 };
10
11
12
13 int irq_handler(uint_t irq, struct vm_device * dev) {
14   PrintDebug("Timer interrupt\n");
15   return 0;
16
17 }
18
19 int timer_init(struct vm_device * dev) {
20   //dev_hook_irq(dev, TIMER_IRQ, &irq_handler);
21
22   return 0;
23 }
24
25 int timer_deinit(struct vm_device * dev) {
26
27   return 0;
28 }
29
30
31 static struct vm_device_ops dev_ops = {
32   .init = timer_init,
33   .deinit = timer_deinit,
34   .reset = NULL,
35   .start = NULL,
36   .stop = NULL,
37
38 };
39
40
41 struct vm_device * create_timer() {
42   struct timer_state * timer = NULL;
43   timer = (struct timer_state *)V3_Malloc( sizeof(struct timer_state));
44   V3_ASSERT(timer != NULL);
45
46   struct vm_device * dev = create_device("Timer", &dev_ops, timer);
47   
48   return dev;
49
50 }