From: Simon Wright <simon@pushface.org>
Subject: Re: Any leap year issues caused by Ada yesterday?
Date: Tue, 06 Mar 2012 20:22:39 +0000
Date: 2012-03-06T20:22:39+00:00 [thread overview]
Message-ID: <m2sjhlh434.fsf@pushface.org> (raw)
In-Reply-To: f7swwaoskj5m$.1aqwzadr8kaul$.dlg@40tude.net
"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> On Tue, 06 Mar 2012 17:59:04 +0000, Simon Wright wrote:
>
>> The timebase ran off the same crystal as the decrementer, so all were
>> internally sync'd. Internally, our synchronised time was
>> (Ada.Calendar.Clock (at last clock interrupt, of course) + high-res time
>> since last clock interrupt).
>
> You could improve that a bit by putting Ada.Calendar.Clock into a loop.
> When it returns a different value, you exit the loop and take that value
> for the time base.
Ada.Calendar.Clock was basically the POSIX gettimeofday() (?) from
VxWorks; which was (epoch + ticks/clockrate). So it was updated at clock
interrupt.
> If the quartz is same you need not to synchronize it anymore. Since the
> multiplier is known you simply add the RTC minus its value at the base
> multiplied by the factor and converted to Duration (or Time_Span) to the
> base and use that instead of the original Ada's Clock.
Didn't want to mess with the RTS use of Ada.Calendar.Time for delays. No
point in using Ada.Real_Time.Time because (then) it was the same as
Ada.Calendar.Time. So we had AC.Time (for internal use only),
<Project>.Calendar.Time for both internal & external use (but not, of
course, for delays).
> Did you check the kernel settings? It has a variable that sets the time
> source to the RTC. This might work on your PPC's BSP. The effect is that
> the system clock is changed each time when queried rather than upon timer
> interrupts.
Don't remember that one.
next prev parent reply other threads:[~2012-03-06 20:23 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
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 [this message]
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