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

Re: [Xen-devel] RE: A question about PIT platform timer

  • To: Keir Fraser <keir@xxxxxxxxxxxxx>, "Tian, Kevin" <kevin.tian@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxxxxxxxx>
  • Date: Mon, 11 Dec 2006 14:59:07 +0000
  • Delivery-date: Mon, 11 Dec 2006 06:59:08 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AccdA44RYK8xaKWxSleokF0BH7qTYQABEEJ1AAU7KvAABTijSQAA0mgl
  • Thread-topic: [Xen-devel] RE: A question about PIT platform timer

On 11/12/06 14:35, "Keir Fraser" <keir@xxxxxxxxxxxxx> wrote:

> On 11/12/06 12:10, "Tian, Kevin" <kevin.tian@xxxxxxxxx> wrote:
>> Yes, there's no interrupt from it. But what's the known frequency?
>> CALIBRATE_LATCH or CLOCK_TICK_RATE? platform_timer_scale
>> is set to the later, and so ch2 needs to work on same frequency or
>> else count value will result incorrect offset. However I didn't see such
>> setting on ch2. Does I miss something? :-)
> All the PIT channels tick at CLOCK_TICK_RATE. Mode-0 is not auto-relatching,
> so when the counter reaches 0000 it carries on FFFF, FFFE, FFFD, ....
> So we calculate platform system time as:
>  system_timestamp + (pit_timestamp - pit_timenow) * (delta_system/delta_pit)

Where, to be explicit, since system time is in nanoseconds we have:
 delta_system = 1000000000
 delta_pit    = CLOCK_TICK_RATE

 -- Keir

Xen-devel mailing list



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