Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Oct 2013 06:36:11 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r257424 - user/glebius/course/01.intro/module
Message-ID:  <201310310636.r9V6aBse056666@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310310636.r9V6aBse056666>