svn commit: r257424 - user/glebius/course/01.intro/module

Gleb Smirnoff glebius at FreeBSD.org
Thu Oct 31 06:36:11 UTC 2013


Author: glebius
Date: Thu Oct 31 06:36:11 2013
New Revision: 257424
URL: http://svnweb.freebsd.org/changeset/base/257424

Log:
  An empty module, that we used to run on the introduction lection.

Added:
  user/glebius/course/01.intro/module/
  user/glebius/course/01.intro/module/Makefile   (contents, props changed)
  user/glebius/course/01.intro/module/module.c   (contents, props changed)

Added: user/glebius/course/01.intro/module/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/glebius/course/01.intro/module/Makefile	Thu Oct 31 06:36:11 2013	(r257424)
@@ -0,0 +1,4 @@
+KMOD=module
+SRCS=module.c
+
+.include <bsd.kmod.mk>

Added: user/glebius/course/01.intro/module/module.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/glebius/course/01.intro/module/module.c	Thu Oct 31 06:36:11 2013	(r257424)
@@ -0,0 +1,21 @@
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+
+static int
+foo_handler(module_t mod, int what, void *arg)
+{
+
+	printf("demo: %d, %p\n", what, arg);
+
+	return (0);
+}
+
+static moduledata_t mod_data= {
+	.name = "foo",
+	.evhand = foo_handler,
+};
+
+MODULE_VERSION(foo, 1);
+DECLARE_MODULE(foo, mod_data, SI_SUB_EXEC, SI_ORDER_ANY);


More information about the svn-src-user mailing list