Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Modularize net/zlib so it can be used by the vnd module ...
details: https://anonhg.NetBSD.org/src/rev/d9711116c73d
branches: trunk
changeset: 325565:d9711116c73d
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Dec 29 08:09:44 2013 +0000
description:
Modularize net/zlib so it can be used by the vnd module (and, eventually,
by an opencrypto module).
diffstat:
sys/dev/vnd.c | 6 +++---
sys/modules/Makefile | 3 ++-
sys/modules/zlib/Makefile | 10 ++++++++++
sys/net/zlib.c | 44 ++++++++++++++++++++++++++++++++++++--------
4 files changed, 51 insertions(+), 12 deletions(-)
diffs (162 lines):
diff -r 0a3572e5a30d -r d9711116c73d sys/dev/vnd.c
--- a/sys/dev/vnd.c Sun Dec 29 03:32:00 2013 +0000
+++ b/sys/dev/vnd.c Sun Dec 29 08:09:44 2013 +0000
@@ -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 @@
#include <sys/module.h>
-MODULE(MODULE_CLASS_DRIVER, vnd, NULL);
+MODULE(MODULE_CLASS_DRIVER, vnd, "zlib");
CFDRIVER_DECL(vnd, DV_DISK, NULL);
static int
diff -r 0a3572e5a30d -r d9711116c73d sys/modules/Makefile
--- a/sys/modules/Makefile Sun Dec 29 03:32:00 2013 +0000
+++ b/sys/modules/Makefile Sun Dec 29 08:09:44 2013 +0000
@@ -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+= vcoda
SUBDIR+= v7fs
SUBDIR+= vnd
+SUBDIR+= zlib
SUBDIR+= tprof
.if (defined(NOTYET))
SUBDIR+= unionfs
diff -r 0a3572e5a30d -r d9711116c73d sys/modules/zlib/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/zlib/Makefile Sun Dec 29 08:09:44 2013 +0000
@@ -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>
diff -r 0a3572e5a30d -r d9711116c73d sys/net/zlib.c
--- a/sys/net/zlib.c Sun Dec 29 03:32:00 2013 +0000
+++ b/sys/net/zlib.c Sun Dec 29 08:09:44 2013 +0000
@@ -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 @@
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 @@
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 @@
*
*/
-/* @(#) $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 @@
* 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 @@
* 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 @@
}
/* --- 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) */
Home |
Main Index |
Thread Index |
Old Index