probe_irq_on, probe_irq_off - safe probing for IRQs
probe_irq_on()
probe_irq_off() tests an internal list of enabled IRQs against its irqs parameter, which should be the value returned by the last probe_irq_on(). This function basically detects which IRQs have been switched off, and thus which ones have received interrupts.
unsigned long irqs;
int irq;
irqs = probe_irq_on();
outb(FB2K_GIVE_ME_AN_INTERRUPT_OR_GIVE_ME_DEATH,
FB2K_CONTROL_PORT);
/* the interrupt could take a while to occur */
udelay(1000);
irq = probe_irq_off(irqs);
if (irq == 0) {
printk("fb2k: could not detect IRQ.\n");
printk("fb2k: Installation failed.\n");
} else if (irq == -1) {
printk("fb2k: multiple IRQs detected.\n");
printk("fb2k: Installation failed.\n");
} else {
fb2k_dev->irq = irq;
printk("fb2k: using probed IRQ %d.\n", irq);
}
probe_irq_off() returns the IRQ number of whichever unhandled interrupt has occurred since the last probe_irq_on(). If no interrupts have occurred on any of the marked IRQs, 0 is returned; if interrupts have occurred on more than one of these IRQs, -1 is returned.
This manpage is way too confusing.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |