2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
25 #include <palacios/vmm_types.h>
26 #include <palacios/vmm_list.h>
31 uint32_t cpu_freq; // in kHZ
33 // Total number of guest run time cycles
36 // Cache value to help calculate the guest_tsc
37 ullong_t cached_host_tsc;
40 /* The total num of numcycles spent in the halt handler
41 that the halt handler has already updated to the
42 timer infrastructure about. That is, "update_time" has been
44 ullong_t cached_hlt_tsc;
46 // The number of cycles pending for notification to the timers
47 //ullong_t pending_cycles;
51 struct list_head timers;
58 void (*update_time)(struct guest_info * info, ullong_t cpu_cycles, ullong_t cpu_freq, void * priv_data);
59 void (*advance_timer)(struct guest_info * info, void * private_data);
64 struct vm_timer_ops * ops;
66 struct list_head timer_link;
72 int v3_add_timer(struct guest_info * info, struct vm_timer_ops * ops, void * private_data);
73 int v3_remove_timer(struct guest_info * info, struct vm_timer * timer);
75 void v3_advance_time(struct guest_info * info);
77 void v3_update_time(struct guest_info * info, ullong_t cycles);
80 void v3_init_time(struct guest_info * info);