diff options
Diffstat (limited to 'tests/projects/linux/driver/hello_makefile/src/hello.c')
| -rw-r--r-- | tests/projects/linux/driver/hello_makefile/src/hello.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/projects/linux/driver/hello_makefile/src/hello.c b/tests/projects/linux/driver/hello_makefile/src/hello.c new file mode 100644 index 000000000..414a03bb2 --- /dev/null +++ b/tests/projects/linux/driver/hello_makefile/src/hello.c @@ -0,0 +1,23 @@ +#include <linux/init.h> +#include <linux/module.h> + +MODULE_LICENSE("Dual BSD/GPL"); +MODULE_AUTHOR("Ruki"); +MODULE_DESCRIPTION("A simple Hello World Module"); +MODULE_ALIAS("a simplest module"); + +int add(int a, int b); + +int hello_init(void) +{ + printk(KERN_INFO "Hello World: %d\n", add(1, 2)); + return 0; +} + +void hello_exit(void) +{ + printk(KERN_INFO "Goodbye World\n"); +} + +module_init(hello_init); +module_exit(hello_exit); |
