X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_time.h;h=9f1c432138a38dda5cfa14f96ad49f43ddc90698;hb=aac189310cca0f5f14543d91413d3b5b58250a3e;hp=43643589888a7699d278aab545d374c3ed87c6f1;hpb=cd3edffa0e451af761b9dcee021ca06ebb301345;p=palacios-OLD.git diff --git a/palacios/include/palacios/vmm_time.h b/palacios/include/palacios/vmm_time.h index 4364358..9f1c432 100644 --- a/palacios/include/palacios/vmm_time.h +++ b/palacios/include/palacios/vmm_time.h @@ -48,34 +48,35 @@ struct vm_time { struct list_head timers; }; - - - -struct vm_timer_ops { +struct v3_timer_ops { void (*update_timer)(struct guest_info * info, ullong_t cpu_cycles, ullong_t cpu_freq, void * priv_data); void (*advance_timer)(struct guest_info * info, void * private_data); }; -struct vm_timer { +struct v3_timer { void * private_data; - struct vm_timer_ops * ops; + struct v3_timer_ops * ops; struct list_head timer_link; }; +// Basic functions for handling passage of time in palacios +void v3_init_time_core(struct guest_info * core); +int v3_init_time_vm(struct v3_vm_info * vm); +void v3_deinit_time_core(struct guest_info * core); +void v3_deinit_time_vm(struct v3_vm_info * vm); -int v3_add_timer(struct guest_info * info, struct vm_timer_ops * ops, void * private_data); -int v3_remove_timer(struct guest_info * info, struct vm_timer * timer); -void v3_update_timers(struct guest_info * info); - +int v3_start_time(struct guest_info * core); +int v3_adjust_time(struct guest_info * core); -void v3_init_time(struct guest_info * info); -int v3_start_time(struct guest_info * info); -int v3_adjust_time(struct guest_info * info); +// Basic functions for attaching timers to the passage of time +struct v3_timer * v3_add_timer(struct guest_info * info, struct v3_timer_ops * ops, void * private_data); +int v3_remove_timer(struct guest_info * info, struct v3_timer * timer); +void v3_update_timers(struct guest_info * info); -// Returns host time +// Functions to return the different notions of time in Palacios. static inline uint64_t v3_get_host_time(struct vm_time *t) { uint64_t tmp; rdtscll(tmp); @@ -97,13 +98,17 @@ static inline sint64_t v3_tsc_host_offset(struct vm_time *time_state) { return time_state->guest_host_offset + time_state->tsc_guest_offset; } - +// Functions for handling exits on the TSC when fully virtualizing +// the timestamp counter. #define TSC_MSR 0x10 #define TSC_AUX_MSR 0xC0000103 int v3_handle_rdtscp(struct guest_info *info); int v3_handle_rdtsc(struct guest_info *info); + + + #endif // !__V3VEE__ #endif