[翻译] Section 5.6. Module Options 模块选项

内核模块通过宏(比如module_param)来定义他们使用的参数

模块注册函数如下例:

...
module_param(multicast_filter_limit, int, 0444);
module_param(max_interrupt_work, int, 0444);
module_param(debug, int, 0444);
...

最终会显示在/sys/module/目录下

[root@localhost src]# ls -la /sys/module/sis900/parameters/
total 0
drwxr-xr-x 2 root root 0 Apr 9 18:31 .
drwxr-xr-x 4 root root 0 Apr 9 18:31 ..
-r--r--r-- 1 root root 0 Apr 9 18:31 debug
-r--r--r-- 1 root root 4096 Apr 9 18:31 max_interrupt_work
-r--r--r-- 1 root root 4096 Apr 9 18:31 multicast_filter_limit

猜你喜欢

转载自blog.csdn.net/qq_28351465/article/details/82144572