Changeset View
Changeset View
Standalone View
Standalone View
sys/libkern/zlib.c
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* Assume this is a *BSD or SVR4 kernel */ | /* Assume this is a *BSD or SVR4 kernel */ | ||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/kernel.h> | |||||
#include <sys/module.h> | |||||
# define HAVE_MEMCPY | # define HAVE_MEMCPY | ||||
#else | #else | ||||
#if defined(__KERNEL__) | #if defined(__KERNEL__) | ||||
/* Assume this is a Linux kernel */ | /* Assume this is a Linux kernel */ | ||||
#include <linux/string.h> | #include <linux/string.h> | ||||
#define HAVE_MEMCPY | #define HAVE_MEMCPY | ||||
▲ Show 20 Lines • Show All 5,307 Lines • ▼ Show 20 Lines | while (len > 0) { | ||||
s2 += s1; | s2 += s1; | ||||
} while (--k); | } while (--k); | ||||
s1 %= BASE; | s1 %= BASE; | ||||
s2 %= BASE; | s2 %= BASE; | ||||
} | } | ||||
return (s2 << 16) | s1; | return (s2 << 16) | s1; | ||||
} | } | ||||
/* --- adler32.c */ | /* --- adler32.c */ | ||||
#ifdef _KERNEL | |||||
static int | |||||
zlib_modevent(module_t mod, int type, void *unused) | |||||
{ | |||||
switch (type) { | |||||
case MOD_LOAD: | |||||
return 0; | |||||
case MOD_UNLOAD: | |||||
return 0; | |||||
} | |||||
return EINVAL; | |||||
} | |||||
static moduledata_t zlib_mod = { | |||||
"zlib", | |||||
zlib_modevent, | |||||
0 | |||||
}; | |||||
DECLARE_MODULE(zlib, zlib_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST); | |||||
MODULE_VERSION(zlib, 1); | |||||
#endif /* _KERNEL */ |