From 4d723c91d21c25fccb153cd2f3b22bc905222d74 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 6 Oct 2007 17:22:36 +0000 Subject: [PATCH] Allow the crc32.c module to be used in userland or kernel code. --- sys/libkern/crc32.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/libkern/crc32.c b/sys/libkern/crc32.c index 9e4e10408c..f35146f1a4 100644 --- a/sys/libkern/crc32.c +++ b/sys/libkern/crc32.c @@ -36,14 +36,24 @@ * using byte-swap instructions * polynomial $edb88320 * - * $FreeBSD: src/sys/libkern/crc32.c,v 1.1.2.1 2002/07/31 09:08:34 imp Exp $ - * $DragonFly: src/sys/libkern/crc32.c,v 1.2 2003/06/17 04:28:42 dillon Exp $ - * * CRC32 code derived from work by Gary S. Brown. + * + * $FreeBSD: src/sys/libkern/crc32.c,v 1.1.2.1 2002/07/31 09:08:34 imp Exp $ + * $DragonFly: src/sys/libkern/crc32.c,v 1.3 2007/10/06 17:22:36 dillon Exp $ + */ + +/* + * WARNING: This code is used by various subsystems including the HAMMER + * filesystem. This code may be directly compiled in userland or kernel + * builds. */ +#ifdef _KERNEL #include #include +#else +#include +#endif uint32_t crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, -- 2.41.0