# HG changeset patch # User cl349@firebug.cl.cam.ac.uk # Date 1116679244 0 # Node ID d55569f2ac1800bda46f923b52b956ac6461dc6e # Parent 07bd52c0f8dedbe91ef0b834c34603979d814f40# Parent 543ffea3fc12a8e7dce6e7e4ece21eee8e7ac4c6 bitkeeper revision 1.1505 (428f2c4c-dG46JqogSF24go6sxrccw) Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-2.0-testing.bk into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk diff -r 07bd52c0f8de -r d55569f2ac18 linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c Sat May 21 10:42:50 2005 +0000 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c Sat May 21 12:40:44 2005 +0000 @@ -692,7 +692,12 @@ void __init time_init(void) /* Convert jiffies to system time. Call with xtime_lock held for reading. */ static inline u64 __jiffies_to_st(unsigned long j) { - return processed_system_time + ((j - jiffies) * NS_PER_TICK); + long delta = j - jiffies; + /* NB. The next check can trigger in some wrap-around cases, but + * that's ok -- we'll just end up with a shorter timeout. */ + if (delta < 1) + delta = 1; + return processed_system_time + (delta * NS_PER_TICK); } /* @@ -728,8 +733,6 @@ int set_timeout_timer(void) } while (read_seqretry(&xtime_lock, seq)); #else j = next_timer_interrupt(); - if (j < (jiffies + 1)) - j = jiffies + 1; alarm = __jiffies_to_st(j); #endif