“irq_to_desc”不明确的?

发布于 2024-12-17 21:00:22 字数 278 浏览 3 评论 0原文

大家。 我需要在我的项目中使用 $irq_to_desc,但尽管我包含了它需要的所有 h 文件,gcc 仍然发出“”irq_to_desc”未定义!”消息。我在这里找到了有关该主题的内容 http://comments.gmane.org/gmane。 linux.kernel.kernelnewbies/34403 但我仍然不明白如何解决这个问题。

everybody.
I need to use $irq_to_desc in my project, but despite the fact I included all h files it needs, gcc still emits ""irq_to_desc" undefined!" messages. I found something on the topic here http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/34403 but I still dont understand how to fix this prroblem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橙幽之幻 2024-12-24 21:00:22

我不相信您可以在模块中使用 irq_to_desc() 。

如果未定义 CONFIG_GENERIC_HARDIRQS,则 irq_to_desc()#define 作为 include/linux/irqnr.h< 中的宏/代码>。由于它引用的变量 irq_desc 不在 EXPORT_SYMBOLEXPORT_SYMBOL_GPL 声明中,我认为您不能使用以下方式链接模块该变量进入内核——只有静态编译的内核代码才能使用它。

如果定义了 CONFIG_GENERIC_HARDIRQS,则函数 irq_to_desc() 会在 include/linux/irqnr.h 中声明并在 kernel/ 中定义irq/irqdesc.c。 kernel/irq/irqdesc.c 中有两个irq_to_desc() 定义,具体取决于 CONFIG_SPARSE_IRQ 的值。该函数没有相应的 EXPORT_SYMBOLEXPORT_SYMBOL_GPL 声明,因此它不能在模块中使用——只能在静态编译的内核代码中使用。

I don't believe you can use irq_to_desc() in a module.

If CONFIG_GENERIC_HARDIRQS isn't defined, then irq_to_desc() is #defined as a macro in include/linux/irqnr.h. Since the variable it references, irq_desc, isn't in an EXPORT_SYMBOL or EXPORT_SYMBOL_GPL declaration, I don't think you could link a module using that variable into the kernel -- only statically compiled in-kernel code can use it.

If CONFIG_GENERIC_HARDIRQS is defined, then a function irq_to_desc() is declared in include/linux/irqnr.h and defined in kernel/irq/irqdesc.c. There are two definitions of irq_to_desc() in kernel/irq/irqdesc.c depending upon the value of CONFIG_SPARSE_IRQ. There is no corresponding EXPORT_SYMBOL or EXPORT_SYMBOL_GPL declaration for the function, so it can't be used in modules -- only statically compiled in-kernel code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文