Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

interrupt.h

Go to the documentation of this file.
00001 /* interrupt.h */
00002 #ifndef _LINUX_INTERRUPT_H
00003 #define _LINUX_INTERRUPT_H
00004 
00005 #include <linux/kernel.h>
00006 #include <asm/bitops.h>
00007 #include <asm/atomic.h>
00008 #include <asm/ptrace.h>
00009 
00010 struct irqaction {
00011         void (*handler)(int, void *, struct pt_regs *);
00012         unsigned long flags;
00013         unsigned long mask;
00014         const char *name;
00015         void *dev_id;
00016         struct irqaction *next;
00017 };
00018 
00019 extern volatile unsigned char bh_running;
00020 
00021 extern atomic_t bh_mask_count[32];
00022 extern unsigned long bh_active;
00023 extern unsigned long bh_mask;
00024 extern void (*bh_base[32])(void);
00025 
00026 asmlinkage void do_bottom_half(void);
00027 
00028 /* Who gets which entry in bh_base.  Things which will occur most often
00029    should come first - in which case NET should be up the top with SERIAL/TQUEUE! */
00030    
00031 enum {
00032         TIMER_BH = 0,
00033         CONSOLE_BH,
00034         TQUEUE_BH,
00035         DIGI_BH,
00036         SERIAL_BH,
00037         RISCOM8_BH,
00038         SPECIALIX_BH,
00039         AURORA_BH,
00040         ESP_BH,
00041         NET_BH,
00042         SCSI_BH,
00043         IMMEDIATE_BH,
00044         KEYBOARD_BH,
00045         CYCLADES_BH,
00046         CM206_BH,
00047         JS_BH,
00048         MACSERIAL_BH,
00049         ISICOM_BH
00050 };
00051 
00052 #include <asm/hardirq.h>
00053 #include <asm/softirq.h>
00054 
00055 /*
00056  * Autoprobing for irqs:
00057  *
00058  * probe_irq_on() and probe_irq_off() provide robust primitives
00059  * for accurate IRQ probing during kernel initialization.  They are
00060  * reasonably simple to use, are not "fooled" by spurious interrupts,
00061  * and, unlike other attempts at IRQ probing, they do not get hung on
00062  * stuck interrupts (such as unused PS2 mouse interfaces on ASUS boards).
00063  *
00064  * For reasonably foolproof probing, use them as follows:
00065  *
00066  * 1. clear and/or mask the device's internal interrupt.
00067  * 2. sti();
00068  * 3. irqs = probe_irq_on();      // "take over" all unassigned idle IRQs
00069  * 4. enable the device and cause it to trigger an interrupt.
00070  * 5. wait for the device to interrupt, using non-intrusive polling or a delay.
00071  * 6. irq = probe_irq_off(irqs);  // get IRQ number, 0=none, negative=multiple
00072  * 7. service the device to clear its pending interrupt.
00073  * 8. loop again if paranoia is required.
00074  *
00075  * probe_irq_on() returns a mask of allocated irq's.
00076  *
00077  * probe_irq_off() takes the mask as a parameter,
00078  * and returns the irq number which occurred,
00079  * or zero if none occurred, or a negative irq number
00080  * if more than one irq occurred.
00081  */
00082 extern unsigned long probe_irq_on(void);        /* returns 0 on failure */
00083 extern int probe_irq_off(unsigned long);        /* returns 0 or negative on failure */
00084 
00085 #endif