“irq_to_desc”不明确的?
大家。 我需要在我的项目中使用 $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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不相信您可以在模块中使用 irq_to_desc() 。
如果未定义
CONFIG_GENERIC_HARDIRQS
,则irq_to_desc()
是#define
作为include/linux/irqnr.h< 中的宏/代码>。由于它引用的变量
irq_desc
不在EXPORT_SYMBOL
或EXPORT_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_SYMBOL
或EXPORT_SYMBOL_GPL
声明,因此它不能在模块中使用——只能在静态编译的内核代码中使用。I don't believe you can use
irq_to_desc()
in a module.If
CONFIG_GENERIC_HARDIRQS
isn't defined, thenirq_to_desc()
is#defined
as a macro ininclude/linux/irqnr.h
. Since the variable it references,irq_desc
, isn't in anEXPORT_SYMBOL
orEXPORT_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 functionirq_to_desc()
is declared ininclude/linux/irqnr.h
and defined inkernel/irq/irqdesc.c
. There are two definitions ofirq_to_desc()
inkernel/irq/irqdesc.c
depending upon the value ofCONFIG_SPARSE_IRQ
. There is no correspondingEXPORT_SYMBOL
orEXPORT_SYMBOL_GPL
declaration for the function, so it can't be used in modules -- only statically compiled in-kernel code.