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.


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