ChangeSet 1.1360.1.18, 2005/03/25 23:02:49+00:00, kaf24@xxxxxxxxxxxxxxxxxxxx
Merge firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into firebug.cl.cam.ac.uk:/local/scratch/kaf24/xen-unstable.bk
time.c | 49 ++++++++++++++++++++++++++++++-------------------
1 files changed, 30 insertions(+), 19 deletions(-)
diff -Nru a/xen/arch/x86/time.c b/xen/arch/x86/time.c
--- a/xen/arch/x86/time.c 2005-03-25 19:06:03 -05:00
+++ b/xen/arch/x86/time.c 2005-03-25 19:06:03 -05:00
@@ -1,5 +1,4 @@
-/* -*- Mode:C; c-basic-offset:4; tab-width:4 -*-
- ****************************************************************************
+/****************************************************************************
* (C) 2002-2003 - Rolf Neugebauer - Intel Research Cambridge
* (C) 2002-2003 University of Cambridge
****************************************************************************
@@ -52,7 +51,7 @@
static unsigned long wc_sec, wc_usec; /* UTC time at last 'time update'. */
static rwlock_t time_lock = RW_LOCK_UNLOCKED;
-static void timer_interrupt(int irq, void *dev_id, struct xen_regs *regs)
+void timer_interrupt(int irq, void *dev_id, struct xen_regs *regs)
{
write_lock_irq(&time_lock);
@@ -275,19 +274,13 @@
return now;
}
-
-int update_dom_time(struct domain *d)
+static inline void __update_dom_time(struct exec_domain *ed)
{
+ struct domain *d = ed->domain;
shared_info_t *si = d->shared_info;
- unsigned long flags;
- if ( d->last_propagated_timestamp == full_tsc_irq )
- return 0;
-
- read_lock_irqsave(&time_lock, flags);
+ spin_lock(&d->time_lock);
- d->last_propagated_timestamp = full_tsc_irq;
-
si->time_version1++;
wmb();
@@ -300,11 +293,20 @@
wmb();
si->time_version2++;
- read_unlock_irqrestore(&time_lock, flags);
-
- return 1;
+ spin_unlock(&d->time_lock);
}
+void update_dom_time(struct exec_domain *ed)
+{
+ unsigned long flags;
+
+ if ( ed->domain->shared_info->tsc_timestamp != full_tsc_irq )
+ {
+ read_lock_irqsave(&time_lock, flags);
+ __update_dom_time(ed);
+ read_unlock_irqrestore(&time_lock, flags);
+ }
+}
/* Set clock to <secs,usecs> after 00:00:00 UTC, 1 January, 1970. */
void do_settime(unsigned long secs, unsigned long usecs, u64 system_time_base)
@@ -326,12 +328,11 @@
wc_sec = secs;
wc_usec = _usecs;
- write_unlock_irq(&time_lock);
-
/* Others will pick up the change at the next tick. */
- current->last_propagated_timestamp = 0; /* force propagation */
- (void)update_dom_time(current);
+ __update_dom_time(current);
send_guest_virq(current, VIRQ_TIMER);
+
+ write_unlock_irq(&time_lock);
}
@@ -386,3 +387,13 @@
setup_irq(0, &irq0);
}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-changelog
|