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

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

 



On Wed, 2007-09-19 at 16:49 +1000, Tony Breeds wrote:
> +/* clocksource code */
> +/* FIXME: provide an RTC clocksource /or/ use a better name */
> +static cycle_t timebase_read(void)
> +{
> +       if (__USE_RTC())
> +               return (cycle_t)get_rtc();
> +       return (cycle_t)get_tb();
> +}

If you switch to the rtc do the shift and mult need to change?

> +void update_vsyscall(struct timespec *wall_time, struct clocksource
> *clock)
> +{
> +       u64 t2x, stamp_xsec;
> +
> +       if (__USE_RTC() || clock != &clocksource_timebase)
> +               return;
> +
> +       /* Make userspace gettimeofday spin until we're done. */
> +       ++vdso_data->tb_update_count;
> +       smp_mb();
> +
> +       /* 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.

Daniel

-
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux