gpt4 book ai didi

linux - request_irq- irq 标志设置为 0 ;这是有效的吗?

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:25:06 25 4
gpt4 key购买 nike

在浏览 2.6.35 时,在某些驱动程序中,观察到 request_irq 被传递给 irq 标志的值 0。当在 interrupt.h 中看到时 - 0 对应于 IRQ_TRIGGER_NONE;

这是否等同于以前内核中的 IRQ_NONE 的情况?

谢谢。

最佳答案

传递到 request_irq() 中的实际标志在注释中定义:

/*
* These flags used only by the kernel as part of the
* irq handling routines.
*
* IRQF_DISABLED - keep irqs disabled when calling the action handler.
* DEPRECATED. This flag is a NOOP and scheduled to be removed
* IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
* IRQF_SHARED - allow sharing the irq among several devices
* IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
* IRQF_TIMER - Flag to mark this interrupt as timer interrupt
* IRQF_PERCPU - Interrupt is per cpu
* IRQF_NOBALANCING - Flag to exclude this interrupt from irq balancing
* IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is
* registered first in an shared interrupt is considered for
* performance reasons)
* IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished.
* Used by threaded interrupts which need to keep the
* irq line disabled until the threaded handler has been run.
* IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
* IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
* IRQF_NO_THREAD - Interrupt cannot be threaded
* IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
* resume time.
*/

这些是位,因此可以传入其中一个子集的逻辑或(即|);如果没有应用,则空集完全没问题——即 flags 参数的值为 0。

由于 IRQF_TRIGGER_NONE 为 0,将 0 传递给 request_irq() 只是表示单独保留 IRQ 的触发配置——即不管硬件/固件如何配置它。

IRQ_NONE 在不同的命名空间中;它是中断处理程序(传递给 request_irq() 的函数)可能的返回值之一,这意味着中断处理程序没有处理中断。

关于linux - request_irq- irq 标志设置为 0 ;这是有效的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8306297/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com