[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Rename update_dom_time() to update_vcpu_system_time().



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 08aede767c63f7814cc89b97b277514a9f9644fc
# Parent  bb316b4df46f0dc436859de52ac68b4fd798f582
Rename update_dom_time() to update_vcpu_system_time().
Introduce new generic function update_domain_wallclock_time().

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r bb316b4df46f -r 08aede767c63 xen/arch/ia64/xen/xentime.c
--- a/xen/arch/ia64/xen/xentime.c       Wed Apr  5 12:38:54 2006
+++ b/xen/arch/ia64/xen/xentime.c       Wed Apr  5 14:00:42 2006
@@ -84,7 +84,13 @@
     return now; 
 }
 
-void update_dom_time(struct vcpu *v)
+void update_vcpu_system_time(struct vcpu *v)
+{
+    /* N-op here, and let dom0 to manage system time directly */
+    return;
+}
+
+void update_domain_wallclock_time(struct domain *d)
 {
     /* N-op here, and let dom0 to manage system time directly */
     return;
diff -r bb316b4df46f -r 08aede767c63 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Wed Apr  5 12:38:54 2006
+++ b/xen/arch/x86/domain.c     Wed Apr  5 14:00:42 2006
@@ -363,7 +363,7 @@
     update_pagetables(v);
 
     if ( v->vcpu_id == 0 )
-        init_domain_time(d);
+        update_domain_wallclock_time(d);
 
     /* Don't redo final setup */
     set_bit(_VCPUF_initialised, &v->vcpu_flags);
diff -r bb316b4df46f -r 08aede767c63 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Wed Apr  5 12:38:54 2006
+++ b/xen/arch/x86/domain_build.c       Wed Apr  5 14:00:42 2006
@@ -773,7 +773,7 @@
     zap_low_mappings(idle_pg_table_l2);
 #endif
 
-    init_domain_time(d);
+    update_domain_wallclock_time(d);
 
     set_bit(_VCPUF_initialised, &v->vcpu_flags);
 
diff -r bb316b4df46f -r 08aede767c63 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Wed Apr  5 12:38:54 2006
+++ b/xen/arch/x86/time.c       Wed Apr  5 14:00:42 2006
@@ -670,7 +670,7 @@
     (*version)++;
 }
 
-static inline void __update_dom_time(struct vcpu *v)
+static inline void __update_vcpu_system_time(struct vcpu *v)
 {
     struct cpu_time       *t;
     struct vcpu_time_info *u;
@@ -688,44 +688,14 @@
     version_update_end(&u->version);
 }
 
-void update_dom_time(struct vcpu *v)
+void update_vcpu_system_time(struct vcpu *v)
 {
     if ( v->domain->shared_info->vcpu_info[v->vcpu_id].time.tsc_timestamp != 
          cpu_time[smp_processor_id()].local_tsc_stamp )
-        __update_dom_time(v);
-}
-
-/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
-void do_settime(unsigned long secs, unsigned long nsecs, u64 system_time_base)
-{
-    u64 x;
-    u32 y, _wc_sec, _wc_nsec;
-    struct domain *d;
-    shared_info_t *s;
-
-    x = (secs * 1000000000ULL) + (u64)nsecs - system_time_base;
-    y = do_div(x, 1000000000);
-
-    wc_sec  = _wc_sec  = (u32)x;
-    wc_nsec = _wc_nsec = (u32)y;
-
-    read_lock(&domlist_lock);
-    spin_lock(&wc_lock);
-
-    for_each_domain ( d )
-    {
-        s = d->shared_info;
-        version_update_begin(&s->wc_version);
-        s->wc_sec  = _wc_sec;
-        s->wc_nsec = _wc_nsec;
-        version_update_end(&s->wc_version);
-    }
-
-    spin_unlock(&wc_lock);
-    read_unlock(&domlist_lock);
-}
-
-void init_domain_time(struct domain *d)
+        __update_vcpu_system_time(v);
+}
+
+void update_domain_wallclock_time(struct domain *d)
 {
     spin_lock(&wc_lock);
     version_update_begin(&d->shared_info->wc_version);
@@ -733,6 +703,27 @@
     d->shared_info->wc_nsec = wc_nsec;
     version_update_end(&d->shared_info->wc_version);
     spin_unlock(&wc_lock);
+}
+
+/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
+void do_settime(unsigned long secs, unsigned long nsecs, u64 system_time_base)
+{
+    u64 x;
+    u32 y, _wc_sec, _wc_nsec;
+    struct domain *d;
+
+    x = (secs * 1000000000ULL) + (u64)nsecs - system_time_base;
+    y = do_div(x, 1000000000);
+
+    spin_lock(&wc_lock);
+    wc_sec  = _wc_sec  = (u32)x;
+    wc_nsec = _wc_nsec = (u32)y;
+    spin_unlock(&wc_lock);
+
+    read_lock(&domlist_lock);
+    for_each_domain ( d )
+        update_domain_wallclock_time(d);
+    read_unlock(&domlist_lock);
 }
 
 static void local_time_calibration(void *unused)
diff -r bb316b4df46f -r 08aede767c63 xen/common/schedule.c
--- a/xen/common/schedule.c     Wed Apr  5 12:38:54 2006
+++ b/xen/common/schedule.c     Wed Apr  5 14:00:42 2006
@@ -572,7 +572,7 @@
     /* Ensure that the domain has an up-to-date time base. */
     if ( !is_idle_vcpu(next) )
     {
-        update_dom_time(next);
+        update_vcpu_system_time(next);
         if ( next->sleep_tick != schedule_data[cpu].tick )
             send_timer_event(next);
     }
@@ -609,7 +609,7 @@
 
     if ( !is_idle_vcpu(v) )
     {
-        update_dom_time(v);
+        update_vcpu_system_time(v);
         send_timer_event(v);
     }
 
@@ -623,7 +623,7 @@
 {
     struct vcpu *v = data;
 
-    update_dom_time(v);
+    update_vcpu_system_time(v);
     send_timer_event(v);
 }
 
diff -r bb316b4df46f -r 08aede767c63 xen/include/asm-x86/time.h
--- a/xen/include/asm-x86/time.h        Wed Apr  5 12:38:54 2006
+++ b/xen/include/asm-x86/time.h        Wed Apr  5 14:00:42 2006
@@ -6,9 +6,6 @@
 
 extern void calibrate_tsc_bp(void);
 extern void calibrate_tsc_ap(void);
-
-struct domain;
-extern void init_domain_time(struct domain *d);
 
 typedef u64 cycles_t;
 
diff -r bb316b4df46f -r 08aede767c63 xen/include/xen/time.h
--- a/xen/include/xen/time.h    Wed Apr  5 12:38:54 2006
+++ b/xen/include/xen/time.h    Wed Apr  5 14:00:42 2006
@@ -55,7 +55,9 @@
 #define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
 #define MICROSECS(_us)  ((s_time_t)((_us) * 1000ULL))
 
-extern void update_dom_time(struct vcpu *v);
+extern void update_vcpu_system_time(struct vcpu *v);
+extern void update_domain_wallclock_time(struct domain *d);
+
 extern void do_settime(
     unsigned long secs, unsigned long nsecs, u64 system_time_base);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.