什么是链接中断?chained_irq_enter
和chained_irq_exit
是做什么的?因为在中断发生后,IRQ线会被禁用,但chained_irq_enter
调用与屏蔽中断相关的函数。如果该行已经被禁用,为什么还要屏蔽中断?
什么是链接中断?chained_irq_enter
和chained_irq_exit
是做什么的?因为在中断发生后,IRQ线会被禁用,但chained_irq_enter
调用与屏蔽中断相关的函数。如果该行已经被禁用,为什么还要屏蔽中断?
irq-gic
驱动程序使用CHAINED GPIO irqchips
方法来处理具有多个GIC的系统; 这个提交增加了这个功能。gpio-omap
驱动程序(上述提到)使用GENERIC CHAINED GPIO irqchips
方法。 请参见此提交。 它从常规的CHAINED GPIO irqchips
转换而来,因此在实时内核上,它将是线程化的IRQ处理程序,但在非实时内核上,它将是硬IRQ处理程序NESTED THREADED GPIO irqchips
方法
chained_irq_enter
和chained_irq_exit
是什么意思?
这些函数实现硬件中断流控,即通知中断控制器芯片何时屏蔽和解除屏蔽当前中断。
对于FastEOI中断控制器(大多数现代方式):
chained_irq_enter()
什么也不做chained_irq_exit()
调用irq_eoi()
回调以告知中断控制器中断处理已完成对于具有掩码/解除屏蔽/确认功能的中断控制器
chained_irq_enter()
屏蔽当前中断,并在设置确认回调时确认它chained_irq_exit()
取消屏蔽中断阅读Linux内核文档,以理解这些API:
https://www.kernel.org/doc/Documentation/gpio/driver.txt
CHAINED GPIO irqchips: these are usually the type that is embedded on an SoC. This means that there is a fast IRQ handler for the GPIOs that gets called in a chain from the parent IRQ handler, most typically the system interrupt controller. This means the GPIO irqchip is registered using irq_set_chained_handler() or the corresponding gpiochip_set_chained_irqchip() helper function, and the GPIO irqchip handler will be called immediately from the parent irqchip, while holding the IRQs disabled. The GPIO irqchip will then end up calling something like this sequence in its interrupt handler:
static irqreturn_t tc3589x_gpio_irq(int irq, void *data) chained_irq_enter(...); generic_handle_irq(...); chained_irq_exit(...);