summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/modules/zlib/Makefile8
-rw-r--r--sys/net/zlib.c24
2 files changed, 32 insertions, 0 deletions
diff --git a/sys/modules/zlib/Makefile b/sys/modules/zlib/Makefile
new file mode 100644
index 0000000..0a475b5
--- /dev/null
+++ b/sys/modules/zlib/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../net
+
+KMOD= zlib
+SRCS= zlib.c
+
+.include <bsd.kmod.mk>
diff --git a/sys/net/zlib.c b/sys/net/zlib.c
index e6e1286..b25d4a2 100644
--- a/sys/net/zlib.c
+++ b/sys/net/zlib.c
@@ -57,6 +57,8 @@
#include <sys/time.h>
#include <sys/systm.h>
#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
# define HAVE_MEMCPY
#else
@@ -5380,3 +5382,25 @@ uLong adler32(adler, buf, len)
return (s2 << 16) | s1;
}
/* --- 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 */
OpenPOWER on IntegriCloud