Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
7
third-party/vendor/nix/test/test_kmod/hello_mod/Makefile
vendored
Normal file
7
third-party/vendor/nix/test/test_kmod/hello_mod/Makefile
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
obj-m += hello.o
|
||||
|
||||
all:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules
|
||||
|
||||
clean:
|
||||
make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) clean
|
||||
26
third-party/vendor/nix/test/test_kmod/hello_mod/hello.c
vendored
Normal file
26
third-party/vendor/nix/test/test_kmod/hello_mod/hello.c
vendored
Normal file
|
|
@ -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");
|
||||
Loading…
Add table
Add a link
Reference in a new issue