diff options
Diffstat (limited to 'languages/cpp/app_templates/kmod/kmod-driver.c')
-rw-r--r-- | languages/cpp/app_templates/kmod/kmod-driver.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kmod/kmod-driver.c b/languages/cpp/app_templates/kmod/kmod-driver.c new file mode 100644 index 00000000..5ddc7ce6 --- /dev/null +++ b/languages/cpp/app_templates/kmod/kmod-driver.c @@ -0,0 +1,22 @@ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/module.h> + +MODULE_DESCRIPTION("My kernel module"); +MODULE_AUTHOR("%{AUTHOR} (%{EMAIL})"); +MODULE_LICENSE("$LICENSE$"); + +static int %{APPNAMELC}_init_module(void) +{ + printk( KERN_DEBUG "Module %{APPNAME} init\n" ); + return 0; +} + +static void %{APPNAMELC}_exit_module(void) +{ + printk( KERN_DEBUG "Module %{APPNAME} exit\n" ); +} + +module_init(%{APPNAMELC}_init_module); +module_exit(%{APPNAMELC}_exit_module); |