Brian Murphy posted this on 8-Oct with no response. Quoting:
Here is a patch to the crc32 library routine to allow explicit
initialization of the tables used by the routines.
I need this to be able to use the crc routines in the early
start up code for my platform which saves crc protected
information (clock speed, machine type) in an eeprom.
The option CONFIG_CRC32_EXPLICIT is defined for the platforms
which need it in the config.in file.
I have removed dynamic allocation of memory because the
memory subsystem is also not initialised at the stage where I
need the crc functions.
/Brian
The current crc32 library code is set up as a core_initcall because it was
being used by net, usb, fs, and bluetooth subsystem drivers. This isn't
early enough for Brian, whose mips arch CPU needs the code in setup_arch.
He's proposed two solutions:
1) Brian's first patch
http://marc.theaimsgroup.com/?l=linux-kernel&m=103410018005672&w=2
defines CONFIG_CRC32_EXPLICIT and his code calls init_crc32() as early as
needed.
2) make an early_initcall that happens before setup_arch is called, but
which then touches all arches.
I'm leaning toward:
3) Since kmalloc() isn't available that early, he's switched to a declared
variable. Don't even bother with an init_crc32() - simply declare and fill
the arrays with their values. Add CONFIG_HISCPU to the lib/Makefile to get
it built-in or modular just as every other crc32 user does.
Thoughts?
-Matt
--
Matt Domsch
Sr. Software Engineer, Lead Engineer, Architect
Dell Linux Solutions http://www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
On Wed, 2002-11-20 at 23:01, [email protected] wrote:
> I have removed dynamic allocation of memory because the
> memory subsystem is also not initialised at the stage where I
> need the crc functions.
How about generating the table at compile time ?