Skip to contentSkip to conversation

explicit CRC32 (early) initialization

PATCH New Brian Murphy 1 participant 1 message Oct 8, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 explicit CRC32 (early) initialization

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

linux/crc32.h +5 -0
@@ -6,6 +6,11 @@
 #define _LINUX_CRC32_H
 
 #include <linux/types.h>
+#include <linux/config.h>
+
+#ifdef CONFIG_CRC32_EXPLICIT
+extern int init_crc32(void);
+#endif
 
 extern u32  crc32_le(u32 crc, unsigned char const *p, size_t len);
 extern u32  crc32_be(u32 crc, unsigned char const *p, size_t len);
crc32.c +9 -43

112 lines not on this page · raw message