2 #ifndef _LINUX_INTERRUPT_H 3 #define _LINUX_INTERRUPT_H 5 #include <linux/kernel.h> 6 #include <asm/bitops.h> 9 void(*handler
)(int,void*,struct pt_regs
*); 14 struct irqaction
*next
; 17 externunsigned long intr_count
; 19 externint bh_mask_count
[32]; 20 externunsigned long bh_active
; 21 externunsigned long bh_mask
; 22 externvoid(*bh_base
[32])(void); 24 asmlinkage
voiddo_bottom_half(void); 26 /* Who gets which entry in bh_base. Things which will occur most often 27 should come first - in which case NET should be up the top with SERIAL/TQUEUE! */ 44 extern inlinevoidinit_bh(int nr
,void(*routine
)(void)) 46 bh_base
[nr
] = routine
; 51 extern inlinevoidmark_bh(int nr
) 53 set_bit(nr
, &bh_active
); 57 * These use a mask count to correctly handle 58 * nested disable/enable calls 60 extern inlinevoiddisable_bh(int nr
) 66 extern inlinevoidenable_bh(int nr
) 68 if(!--bh_mask_count
[nr
]) 73 * start_bh_atomic/end_bh_atomic also nest 74 * naturally by using a counter 76 extern inlinevoidstart_bh_atomic(void) 82 extern inlinevoidend_bh_atomic(void) 89 * Autoprobing for irqs: 91 * probe_irq_on() and probe_irq_off() provide robust primitives 92 * for accurate IRQ probing during kernel initialization. They are 93 * reasonably simple to use, are not "fooled" by spurious interrupts, 94 * and, unlike other attempts at IRQ probing, they do not get hung on 95 * stuck interrupts (such as unused PS2 mouse interfaces on ASUS boards). 97 * For reasonably foolproof probing, use them as follows: 99 * 1. clear and/or mask the device's internal interrupt. 101 * 3. irqs = probe_irq_on(); // "take over" all unassigned idle IRQs 102 * 4. enable the device and cause it to trigger an interrupt. 103 * 5. wait for the device to interrupt, using non-intrusive polling or a delay. 104 * 6. irq = probe_irq_off(irqs); // get IRQ number, 0=none, negative=multiple 105 * 7. service the device to clear its pending interrupt. 106 * 8. loop again if paranoia is required. 108 * probe_irq_on() returns a mask of allocated irq's. 110 * probe_irq_off() takes the mask as a parameter, 111 * and returns the irq number which occurred, 112 * or zero if none occurred, or a negative irq number 113 * if more than one irq occurred. 115 externunsigned longprobe_irq_on(void);/* returns 0 on failure */ 116 externintprobe_irq_off(unsigned long);/* returns 0 or negative on failure */