Re: adding accuracy to random timers on PPC - new config option or runtime overhead?

From: Gabriel Paubert (paubert@iram.es)
Date: Thu Aug 23 2001 - 03:15:04 EST


On Wed, 22 Aug 2001, Chris Friesen wrote:

>
> I'm looking at putting in PPC-specific code in add_timer_randomness() that would
> be similar to the x86-specific stuff.
>
> The problem is that the PPC601 uses real time clock registers while the other
> PPC chips use a timebase register, so two different versions will be required.
> Should I try and identify at runtime which it is (which would be extra
> overhead), or should I add another config option to the kernel?

Look at how it's done in do_gettimeofday (expand the macros). Note that
the USE_RTC was not yet perfect last time I looked at it: it should only
perform a test whenever 601 support is enabled (there are so many problems
with 601).

Don't forget that in the case of a 601, you have to shift the least
significant word right by 7 bits since the register increments by 128
every 128 nanoseconds. But the upper word changes more often...

However, it would perhaps be better to define the code as a macro in
asm-${ARCH}/whatever.h and fall back to jiffies in case the macro is not
defined. Arch dependent ifdef'ed code should be avoided.

        Gabriel.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:00:54 EST