[FWL] Darn it.
Rob Landley
rob at landley.net
Mon Dec 29 21:41:35 PST 2008
The description I wrote up for the first perl removal patch is:
> Simplify timeconst.h generation: Instead of pregenerating perl initializers
> and gluing them into the perl program that generated those initializers
> (as the old code did), just pregenerate the actual header file.
>
> The old perl code "precomputed values for systems without Math::BigInt",
> creating a big "canned_values" perl initializer. It then ran the perl
> code every build to create a header file with the values for a single HZ
> value, and an #ifdef that errored out if HZ didn't match the one it knew.
>
> This patch teaches the perl to create a single header file with all the
> information for several different HZ values, in an #if/#elif staircase
> checking each one and only erroring out if none of them match. At the top
> of the file is a comment saying how the file was generated, so you can cut
> and paste the line if you need to add more values.
>
> It then ships a pregenerated version of the header file with the 15 values
> the previous non-BigInt case knew, and removes the make infrastructure for
> automatically generating that file. (From what? You have to patch the
> kconfig files in order to add an option to use a new value anyway.)
And there's a problem. If you go to the kernel source and do:
find . -name "Kconfig*" | xargs grep -A 10 "^config[ \t]*HZ"
You get the following "default" lines:
./arch/um/Kconfig.common- default 100
./arch/frv/Kconfig- default 1000
./arch/xtensa/Kconfig- default 100
./arch/arm/Kconfig- default 128 if ARCH_L7200
./arch/arm/Kconfig- default 200 if ARCH_EBSA110 || ARCH_S3C2410
./arch/arm/Kconfig- default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
./arch/arm/Kconfig- default AT91_TIMER_HZ if ARCH_AT91
./arch/arm/Kconfig- default 100
./arch/h8300/Kconfig- default 100
./arch/m68k/Kconfig- default 100
./arch/cris/Kconfig- default 100
./arch/alpha/Kconfig- default 1200 if ALPHA_RAWHIDE
./arch/alpha/Kconfig- default 1024
./arch/mn10300/Kconfig- default 1000
./arch/ia64/Kconfig- default 32
./arch/sparc/Kconfig- default 100
./arch/m68knommu/Kconfig- default 1000 if CLEOPATRA
./arch/m68knommu/Kconfig- default 100
./arch/mips/Kconfig- default 48 if HZ_48
./arch/mips/Kconfig- default 100 if HZ_100
./arch/mips/Kconfig- default 128 if HZ_128
./arch/mips/Kconfig- default 250 if HZ_250
./arch/mips/Kconfig- default 256 if HZ_256
./arch/mips/Kconfig- default 1000 if HZ_1000
./arch/mips/Kconfig- default 1024 if HZ_1024
./arch/m32r/Kconfig- default 100
./kernel/Kconfig.hz- default 100 if HZ_100
./kernel/Kconfig.hz- default 250 if HZ_250
./kernel/Kconfig.hz- default 300 if HZ_300
./kernel/Kconfig.hz- default 1000 if HZ_1000
The two interesting ones are:
./arch/arm/Kconfig- default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
./arch/arm/Kconfig- default AT91_TIMER_HZ if ARCH_AT91
That's not setting HZ to a value, that's setting it to another variable:
landley at driftwood:~/linux/hg$ find . -name "Kconfig*" | xargs grep -A 3
"^config[ \t]*OMAP_32K_TIMER_HZ"
./arch/arm/plat-omap/Kconfig:config OMAP_32K_TIMER_HZ
./arch/arm/plat-omap/Kconfig- int "Kernel internal timer frequency for
32KHz timer"
./arch/arm/plat-omap/Kconfig- range 32 1024
./arch/arm/plat-omap/Kconfig- depends on OMAP_32K_TIMER
landley at driftwood:~/linux/hg$ find . -name "Kconfig*" | xargs grep -A 3
"^config[ \t]*AT91_TIMER_HZ"
./arch/arm/mach-at91/Kconfig:config AT91_TIMER_HZ
./arch/arm/mach-at91/Kconfig- int "Kernel HZ (jiffies per second)"
./arch/arm/mach-at91/Kconfig- range 32 1024
./arch/arm/mach-at91/Kconfig- depends on ARCH_AT91
An arbitrary, user-enterable range. The help text for OMAP says it must be a
factor of 32768 (so a power of 2), but the AT91 has options for higher
precision chips you can enter an arbitrary value for. (Why you would do this
is never explained, there's no _reason_ for it, whatever you choose is
hardwired into the kernel, but there is the capability and with my patch doing
so would break the build.)
So I've got to generate this file dynamically, probably using dc. Fun...
Rob
More information about the firmware
mailing list