comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Any leap year issues caused by Ada yesterday?
Date: Tue, 06 Mar 2012 16:46:35 +0000
Date: 2012-03-06T16:46:35+00:00	[thread overview]
Message-ID: <m21up5isno.fsf@pushface.org> (raw)
In-Reply-To: d37aucb0avr1$.ihxbw6kqhx1e$.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> Under VxWorks you can read the TSC without assembly, there is a library
> function for that (pentiumTscGet64).
>
>    type Timestamp is new Unsigned_64;
>    procedure pentiumTscGet64 (Clock : out Timestamp);
>    pragma Import (C, pentiumTscGet64, "pentiumTscGet64");
>
> should do the work.

Not sure if there was an equivalent for PPC.

> The actual problem is to get the multiplier, the BIOS time, and keeping the
> TSC synchronized with the system clock. Funnily Wind River did all that for
> Pentium IV. But then they were too lazy to support it on more recent x86
> processors. The most troublesome thing about VxWorks is that Wind River
> adds and removes its parts at will. There is no such thing as backward
> compatibility whatsoever.

The board manufacturer defined the multiplier for us, so no problems.

> As for multicore/sleep mode issues, AFAIK Intel fixed that, i.e. the TSC
> frequency is never changed. I don't know anything about MacOS, but probably
> they deploy the same lousy schema of getting time from the PIT timer or
> something like that, so the problems.

I think I may have misunderstood the evidence here. Trying it again, the
TSC runs at pretty close to the nominal 2.4 GHz, but it was unreasonable
of me to try to *measure* it by looping for a second and seeing how much
the TSC changed, and then be surprised at errors of the order of a few
milliseconds. But, as you say, you have to calibrate the TSC somehow.



  parent reply	other threads:[~2012-03-06 16:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 13:06 Any leap year issues caused by Ada yesterday? Georg Bauhaus
2012-03-05 11:07 ` tonyg
2012-03-05 15:59   ` Shark8
2012-03-05 18:03     ` Dmitry A. Kazakov
2012-03-05 18:30       ` Simon Wright
2012-03-05 20:17         ` Dmitry A. Kazakov
2012-03-05 20:56           ` Simon Wright
2012-03-06  8:47             ` Dmitry A. Kazakov
2012-03-06  9:20               ` Simon Wright
2012-03-06 10:07                 ` Dmitry A. Kazakov
2012-03-06 10:51                   ` Georg Bauhaus
2012-03-06 11:16                     ` Dmitry A. Kazakov
2012-03-06 16:46                   ` Simon Wright [this message]
2012-03-06 17:37                     ` Dmitry A. Kazakov
2012-03-06 17:59                       ` Simon Wright
2012-03-06 19:18                         ` Dmitry A. Kazakov
2012-03-06 20:22                           ` Simon Wright
2012-03-06 19:08                       ` Shark8
2012-03-06 19:40                         ` Dmitry A. Kazakov
2012-03-06 21:00                       ` tmoran
2012-03-06 21:37                         ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox