summaryrefslogtreecommitdiff
path: root/test/test_kmod/hello_mod/hello.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_kmod/hello_mod/hello.c')
-rw-r--r--test/test_kmod/hello_mod/hello.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/test_kmod/hello_mod/hello.c b/test/test_kmod/hello_mod/hello.c
new file mode 100644
index 00000000..1c34987d
--- /dev/null
+++ b/test/test_kmod/hello_mod/hello.c
@@ -0,0 +1,26 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0+ or MIT
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+static int number= 1;
+static char *who = "World";
+
+module_param(number, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+MODULE_PARM_DESC(myint, "Just some number");
+module_param(who, charp, 0000);
+MODULE_PARM_DESC(who, "Whot to greet");
+
+int init_module(void)
+{
+ printk(KERN_INFO "Hello %s (%d)!\n", who, number);
+ return 0;
+}
+
+void cleanup_module(void)
+{
+ printk(KERN_INFO "Goodbye %s (%d)!\n", who, number);
+}
+
+MODULE_LICENSE("Dual MIT/GPL");