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 / include / palacios / vmm_time.h
1 /* Northwestern University */
2 /* (c) 2008, Jack Lange <jarusl@cs.northwestern.edu> */
3
4 #ifndef __VMM_TIME_H
5 #define __VMM_TIME_H
6
7
8 #include <palacios/vmm_types.h>
9 #include <palacios/vmm_list.h>
10
11 struct guest_info;
12
13 struct vm_time {
14   uint32_t cpu_freq; // in kHZ
15
16   // Total number of guest run time cycles
17   ullong_t guest_tsc;
18
19   // Cache value to help calculate the guest_tsc
20   ullong_t cached_host_tsc;
21
22   // The number of cycles pending for notification to the timers
23   //ullong_t pending_cycles;
24
25   // Installed Timers 
26   uint_t num_timers;
27   struct list_head timers;
28 };
29
30
31 #ifdef __V3VEE__
32
33 struct vm_timer_ops {
34  void (*update_time)(ullong_t cpu_cycles, ullong_t cpu_freq, void * priv_data);
35
36 };
37
38 struct vm_timer {
39   void * private_data;
40   struct vm_timer_ops * ops;
41
42   struct list_head timer_link;
43 };
44
45
46
47
48 int v3_add_timer(struct guest_info * info, struct vm_timer_ops * ops, void * private_data);
49 int v3_remove_timer(struct guest_info * info, struct vm_timer * timer);
50
51
52 void v3_update_time(struct guest_info * info, ullong_t cycles);
53
54 #endif // !__V3VEE__
55
56
57 void v3_init_time(struct guest_info * info);
58
59
60
61 #endif