[PATCH 2/5] Implement generic time of day clocksource for powerpc machines.

Daniel Walker dwalker at mvista.com
Thu Sep 20 11:35:51 EST 2007


On Thu, 2007-09-20 at 10:52 +1000, Paul Mackerras wrote:
> Daniel Walker writes:
> 
> > If you switch to the rtc do the shift and mult need to change?
> 
> You can't switch; any given CPU chip will have either the RTC or the
> timebase but not both.

The code is switching between to clock read functions .. If they are
running at different frequencies then the time isn't going to be
converted to nanosecond properly.

So is the rtc running at the same frequency as the timebase? I'd guess
no..

> > > +       /* XXX this assumes clock->shift == 22 */
> > > +       /* 4611686018 ~= 2^(20+64-22) / 1e9 */
> > > +       t2x = (u64) clock->mult * 4611686018ULL;
> > 
> > It might make the code more readable if you put that constant into a
> > macro that gives it a name.
> 
> The comment already gives more information than some arbitrary name
> would.

I'm not a powerpc expect, but I have no idea what that constant is..

Daniel




More information about the Linuxppc-dev mailing list