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

lxu*_*usr 1 linux linux-device-driver linux-kernel

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

这相当于IRQ_NONE以前内核中的情况吗?

谢谢.

Rol*_*and 6

传入的实际标志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.
 */
Run Code Online (Sandbox Code Playgroud)

这些是位,因此可以传入这些子集的逻辑OR(即|); 如果不适用,则空集完全正常 - 即flags参数的值为0.

由于IRQF_TRIGGER_NONE为0,将0传递到request_irq()刚才说只留下IRQ的触发配置 - 即硬件/固件配置它.

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