Import 2.1.34
[davej-history.git] / include / linux / interrupt.h
blob7c8bbd9d0eca651b0661d275605c4908f7d71e9b
1 /* interrupt.h */
2 #ifndef _LINUX_INTERRUPT_H
3 #define _LINUX_INTERRUPT_H
5 #include <linux/kernel.h>
6 #include <asm/bitops.h>
7 #include <asm/atomic.h>
9 struct irqaction {
10 void(*handler)(int,void*,struct pt_regs *);
11 unsigned long flags;
12 unsigned long mask;
13 const char*name;
14 void*dev_id;
15 struct irqaction *next;
18 extern volatileunsigned char bh_running;
20 externint bh_mask_count[32];
21 externunsigned long bh_active;
22 externunsigned long bh_mask;
23 externvoid(*bh_base[32])(void);
25 asmlinkage voiddo_bottom_half(void);
27 /* Who gets which entry in bh_base. Things which will occur most often
28 should come first - in which case NET should be up the top with SERIAL/TQUEUE! */
30 enum{
31 TIMER_BH =0,
32 CONSOLE_BH,
33 TQUEUE_BH,
34 DIGI_BH,
35 SERIAL_BH,
36 RISCOM8_BH,
37 ESP_BH,
38 NET_BH,
39 IMMEDIATE_BH,
40 KEYBOARD_BH,
41 CYCLADES_BH,
42 CM206_BH
45 #include <asm/hardirq.h>
46 #include <asm/softirq.h>
49 * Autoprobing for irqs:
51 * probe_irq_on() and probe_irq_off() provide robust primitives
52 * for accurate IRQ probing during kernel initialization. They are
53 * reasonably simple to use, are not "fooled" by spurious interrupts,
54 * and, unlike other attempts at IRQ probing, they do not get hung on
55 * stuck interrupts (such as unused PS2 mouse interfaces on ASUS boards).
57 * For reasonably foolproof probing, use them as follows:
59 * 1. clear and/or mask the device's internal interrupt.
60 * 2. sti();
61 * 3. irqs = probe_irq_on(); // "take over" all unassigned idle IRQs
62 * 4. enable the device and cause it to trigger an interrupt.
63 * 5. wait for the device to interrupt, using non-intrusive polling or a delay.
64 * 6. irq = probe_irq_off(irqs); // get IRQ number, 0=none, negative=multiple
65 * 7. service the device to clear its pending interrupt.
66 * 8. loop again if paranoia is required.
68 * probe_irq_on() returns a mask of allocated irq's.
70 * probe_irq_off() takes the mask as a parameter,
71 * and returns the irq number which occurred,
72 * or zero if none occurred, or a negative irq number
73 * if more than one irq occurred.
75 externunsigned longprobe_irq_on(void);/* returns 0 on failure */
76 externintprobe_irq_off(unsigned long);/* returns 0 or negative on failure */
78 #endif
close