问题描述
在MFD
设备中.我想了解我们如何到达irq base
.它是一个随机数吗?
In an MFD
device. I wanted to understand, how do we arrive at irq base
. Is it a random number.?
请有人解释.
推荐答案
基本上,在尝试为该IRQ号注册ISR之前,首先需要将特定的IRQ号与实际的物理硬件中断相关联.这通常是在Linux内核中使用 irq_domain_add_linear()
.
Basically one first needs to associate a particular IRQ number with an actual physical hardware interrupt before attempting to register an ISR for that IRQ number. This is commonly done in the Linux kernel using irq_domain_add_linear()
.
irq_alloc_desc*()
和 irq_free_desc*()
API提供了irq编号分配,但它们不提供对控制器本地IRQ的反向映射的任何支持( hwirq)号插入Linux IRQ号空间.
The irq_alloc_desc*()
and irq_free_desc*()
APIs provide allocation of irq numbers, but they don't provide any support for reverse mapping of the controller-local IRQ (hwirq) number into the Linux IRQ number space.
Linux内核的当前设计使用单个较大的数字空间,其中为每个单独的IRQ源分配了一个不同的数字.当只有一个中断控制器时,这很简单,但是在具有多个中断控制器的系统中,内核必须确保为每个中断控制器分配了不重叠的Linux IRQ号分配.
The current design of the Linux kernel uses a single large number space where each separate IRQ source is assigned a different number. This is simple when there is only one interrupt controller, but in systems with multiple interrupt controllers the kernel must ensure that each one gets assigned non-overlapping allocations of Linux IRQ numbers.
更多详细信息,请参见Linux内核 文档/IRQ域. txt .
More details in the Linux-kernel Documentation/IRQ-domain.txt.
这篇关于如何到达MFD设备的irq基础?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!