Module Name:    src
Committed By:   pgoyette
Date:           Sun Dec 29 08:09:45 UTC 2013

Modified Files:
        src/sys/dev: vnd.c
        src/sys/modules: Makefile
        src/sys/net: zlib.c
Added Files:
        src/sys/modules/zlib: Makefile

Log Message:
Modularize net/zlib so it can be used by the vnd module (and, eventually,
by an opencrypto module).


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/sys/dev/vnd.c
cvs rdiff -u -r1.130 -r1.131 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/zlib/Makefile
cvs rdiff -u -r1.33 -r1.34 src/sys/net/zlib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/vnd.c
diff -u src/sys/dev/vnd.c:1.226 src/sys/dev/vnd.c:1.227
--- src/sys/dev/vnd.c:1.226	Sun Sep 15 16:05:51 2013
+++ src/sys/dev/vnd.c	Sun Dec 29 08:09:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnd.c,v 1.226 2013/09/15 16:05:51 martin Exp $	*/
+/*	$NetBSD: vnd.c,v 1.227 2013/12/29 08:09:44 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.226 2013/09/15 16:05:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.227 2013/12/29 08:09:44 pgoyette Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_vnd.h"
@@ -2014,7 +2014,7 @@ vnd_set_geometry(struct vnd_softc *vnd)
 
 #include <sys/module.h>
 
-MODULE(MODULE_CLASS_DRIVER, vnd, NULL);
+MODULE(MODULE_CLASS_DRIVER, vnd, "zlib");
 CFDRIVER_DECL(vnd, DV_DISK, NULL);
 
 static int

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.130 src/sys/modules/Makefile:1.131
--- src/sys/modules/Makefile:1.130	Sat Dec 28 19:45:13 2013
+++ src/sys/modules/Makefile	Sun Dec 29 08:09:44 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.130 2013/12/28 19:45:13 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.131 2013/12/29 08:09:44 pgoyette Exp $
 
 .include <bsd.own.mk>
 
@@ -92,6 +92,7 @@ SUBDIR+=	usbverbose
 SUBDIR+=	vcoda
 SUBDIR+=	v7fs
 SUBDIR+=	vnd
+SUBDIR+=	zlib
 SUBDIR+=	tprof
 .if (defined(NOTYET))
 SUBDIR+=	unionfs

Index: src/sys/net/zlib.c
diff -u src/sys/net/zlib.c:1.33 src/sys/net/zlib.c:1.34
--- src/sys/net/zlib.c:1.33	Wed Mar 18 10:22:42 2009
+++ src/sys/net/zlib.c	Sun Dec 29 08:09:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $	*/
+/*	$NetBSD: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $	*/
 /*
  * This file is derived from various .h and .c files from the zlib-1.0.4
  * distribution by Jean-loup Gailly and Mark Adler, with some additions
@@ -11,7 +11,7 @@
  * - added inflateIncomp and deflateOutputPending
  * - allow strm->next_out to be NULL, meaning discard the output
  *
- * $Id: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $
+ * $Id: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $
  */
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $");
 
 #define NO_DUMMY_DECL
 #define NO_ZCFUNCS
@@ -45,7 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: zlib.c,v 1.3
    subject to change. Applications should only use zlib.h.
  */
 
-/* @(#) $Id: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $ */
+/* @(#) $Id: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $ */
 
 #ifndef _Z_UTIL_H
 #define _Z_UTIL_H
@@ -294,7 +294,7 @@ void   zcfree(voidpf opaque, voidpf ptr)
    subject to change. Applications should only use zlib.h.
  */
 
-/* @(#) $Id: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $ */
+/* @(#) $Id: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $ */
 
 #ifndef _DEFLATE_H
 #define _DEFLATE_H
@@ -656,7 +656,7 @@ void _tr_stored_type_only(deflate_state 
  *
  */
 
-/* @(#) $Id: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $ */
+/* @(#) $Id: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $ */
 
 /* #include "deflate.h" */
 
@@ -1999,7 +1999,7 @@ local block_state deflate_slow(deflate_s
  *          Addison-Wesley, 1983. ISBN 0-201-06672-6.
  */
 
-/* @(#) $Id: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $ */
+/* @(#) $Id: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $ */
 
 /* #define GEN_TREES_H */
 
@@ -5813,7 +5813,7 @@ void  zcfree (opaque, ptr)
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
-/* @(#) $Id: zlib.c,v 1.33 2009/03/18 10:22:42 cegger Exp $ */
+/* @(#) $Id: zlib.c,v 1.34 2013/12/29 08:09:44 pgoyette Exp $ */
 
 /* #include "zlib.h" */
 
@@ -5855,3 +5855,31 @@ uLong ZEXPORT adler32(uLong adler, const
 }
 /* --- adler32.c */
 
+#if defined(_KERNEL)
+
+/*
+ * NetBSD module glue - this code is required for the vnd and swcrypto
+ * pseudo-devices.
+ */
+#include <sys/module.h>
+
+static int zlib_modcmd(modcmd_t, void *);
+
+MODULE(MODULE_CLASS_MISC, zlib, NULL);
+ 
+static int
+zlib_modcmd(modcmd_t cmd, void *arg)
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+	case MODULE_CMD_FINI:
+		return 0;
+	case MODULE_CMD_STAT:
+	case MODULE_CMD_AUTOUNLOAD:
+	default:
+		return ENOTTY;
+	}
+}
+
+#endif	/* defined(_KERNEL) */

Added files:

Index: src/sys/modules/zlib/Makefile
diff -u /dev/null src/sys/modules/zlib/Makefile:1.1
--- /dev/null	Sun Dec 29 08:09:45 2013
+++ src/sys/modules/zlib/Makefile	Sun Dec 29 08:09:44 2013
@@ -0,0 +1,10 @@
+#	$NetBSD: Makefile,v 1.1 2013/12/29 08:09:44 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/net
+
+KMOD=	zlib
+SRCS=	zlib.c
+
+.include <bsd.kmodule.mk>

Reply via email to