#include <linux/init.h>
#include <linux/module.h>
#include <linux/interrupt.h>
MODULE_LICENSE("Dual BSD/GPL");
static int example_init(void) {
printk("<1>EXAMPLE: init\n");
do_softirq();
return 0;
}
static void example_exit(void) {
printk("<1>EXAMPLE: exit\n");
}
module_init(example_init);
module_exit(example_exit);在ubuntu20.04上构建模块。我有个错误。
ERROR: "do_softirq" undefined!有什么建议来修正这个错误吗?
发布于 2020-10-05 03:48:07
你为什么要做这个程序?在特定情况下调用的是内部内核函数--以及线程中的其他函数。您不应该从内核的模块调用它。
要编译示例模块,可以尝试在内核中导出这个符号-如下所示:
EXPORT_SYMBOL(do_softirq);在softirq.c文件中,但不建议这样做。尝试查找tasklet、workqueue接口或k线程。
https://stackoverflow.com/questions/64201949
复制相似问题