Ядро Linux в комментариях

Include/linux/interrupt.h


14836 /* interrupt.h */ 14837 #ifndef _LINUX_INTERRUPT_H 14838 #define _LINUX_INTERRUPT_H 14839 14840 #include <linux/kernel.h> 14841 #include <asm/bitops.h> 14842 #include <asm/atomic.h> 14843 14844 struct irqaction { 14845 void (*handler)(int, void *, struct pt_regs *); 14846 unsigned long flags; 14847 unsigned long mask; 14848 const char *name; 14849 void *dev_id; 14850 struct irqaction *next; 14851 }; 14852 14853 extern volatile unsigned char bh_running; 14854 14855 extern atomic_t bh_mask_count[32]; 14856 extern unsigned long bh_active; 14857 extern unsigned long bh_mask; 14858 extern void (*bh_base[32])(void); 14859 14860 asmlinkage void do_bottom_half(void); 14861 14862 /* Who gets which entry in bh_base. Things which will 14863 occur most often should come first - in which case NET 14864 should be up the top with SERIAL/TQUEUE! */ 14865 14866 enum { 14867 TIMER_BH = 0, 14868 CONSOLE_BH, 14869 TQUEUE_BH, 14870 DIGI_BH, 14871 SERIAL_BH, 14872 RISCOM8_BH, 14873 SPECIALIX_BH, 14874 ESP_BH, 14875 NET_BH, 14876 SCSI_BH, 14877 IMMEDIATE_BH, 14878 KEYBOARD_BH, 14879 CYCLADES_BH, 14880 CM206_BH, 14881 JS_BH, 14882 MACSERIAL_BH, 14883 ISICOM_BH 14884 }; 14885 14886 #include <asm/hardirq.h> 14887 #include <asm/softirq.h> 14888 14889 /* Autoprobing for irqs: 14890 * 14891 * probe_irq_on() and probe_irq_off() provide robust 14892 * primitives for accurate IRQ probing during kernel 14893 * initialization. They are reasonably simple to use, 14894 * are not "fooled" by spurious interrupts, and, unlike 14895 * other attempts at IRQ probing, they do not get hung on 14896 * stuck interrupts (such as unused PS2 mouse interfaces 14897 * on ASUS boards). 14898 * 14899 * For reasonably foolproof probing, use them as follows: 14900 * 14901 * 1. clear and/or mask the device's internal interrupt. 14902 * 2. sti(); 14903 * 3. irqs = probe_irq_on(); 14904 * // "take over" all unassigned idle IRQs 14905 * 4. enable the device and cause it to trigger 14906 * an interrupt. 14907 * 5. wait for the device to interrupt, using 14908 * non-intrusive polling or a delay. 14909 * 6. irq = probe_irq_off(irqs); 14910 * // get IRQ number, 0=none, negative=multiple 14911 * 7. service the device to clear its pending interrupt. 14912 * 8. loop again if paranoia is required. 14913 * 14914 * probe_irq_on() returns a mask of allocated irq's. 14915 * 14916 * probe_irq_off() takes the mask as a parameter, 14917 * and returns the irq number which occurred, 14918 * or zero if none occurred, or a negative irq number 14919 * if more than one irq occurred. */ 14920 extern unsigned long probe_irq_on(void); /*== 0 on fail*/ 14921 extern int probe_irq_off(unsigned long); /*<= 0 on fail*/ 14922 14923 #endif



Содержание раздела