From: Beth Kon Subject: Question about hpet calls to set_timer Date: Fri, 15 Aug 2008 14:41:42 -0400 Message-ID: <1218825702.13649.8.camel@beth-ubuntu> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hello. I'm looking over the Xen hpet.c to see what I can steal for the qemu implementation I'm working on. (Thank you kindly :-) One thing that doesn't make sense to me is why, in hpet_timer_fn, the timer is set with: set_timer(&h->timers[tn], NOW() + hpet_tick_to_ns(h, period)); rather than calculating the difference between the final value of the comparator (after the time_after loop) and the current time. This is the approach used in hpet_set_timer: set_timer(&h->timers[tn], NOW() + hpet_tick_to_ns(h, diff)); and would seem to be the best way to get as close to the desired expire time as possible. Can someone explain why the approaches are different in these 2 places? -- Elizabeth Kon (Beth) IBM Linux Technology Center Open Hypervisor Team email: eak@us.ibm.com