File: /usr/include/linux/irq.h

1     #ifndef __irq_h
2     #define __irq_h
3     
4     #include <linux/cache.h>
5     #include <linux/spinlock.h>
6     
7     #include <asm/irq.h>
8     #include <asm/ptrace.h>
9     
10     /*
11      * IRQ line status.
12      */
13     #define IRQ_INPROGRESS	1	/* IRQ handler active - do not enter! */
14     #define IRQ_DISABLED	2	/* IRQ disabled - do not enter! */
15     #define IRQ_PENDING	4	/* IRQ pending - replay on enable */
16     #define IRQ_REPLAY	8	/* IRQ has been replayed but not acked yet */
17     #define IRQ_AUTODETECT	16	/* IRQ is being autodetected */
18     #define IRQ_WAITING	32	/* IRQ not yet seen - for autodetection */
19     #define IRQ_LEVEL	64	/* IRQ level triggered */
20     #define IRQ_MASKED	128	/* IRQ masked - shouldn't be seen again */
21     #define IRQ_PER_CPU	256	/* IRQ is per CPU */
22     
23     /*
24      * Interrupt controller descriptor. This is all we need
25      * to describe about the low-level hardware. 
26      */
27     struct hw_interrupt_type {
28     	const char * typename;
29     	unsigned int (*startup)(unsigned int irq);
30     	void (*shutdown)(unsigned int irq);
31     	void (*enable)(unsigned int irq);
32     	void (*disable)(unsigned int irq);
33     	void (*ack)(unsigned int irq);
34     	void (*end)(unsigned int irq);
35     	void (*set_affinity)(unsigned int irq, unsigned long mask);
36     };
37     
38     typedef struct hw_interrupt_type  hw_irq_controller;
39     
40     /*
41      * This is the "IRQ descriptor", which contains various information
42      * about the irq, including what kind of hardware handling it has,
43      * whether it is disabled etc etc.
44      *
45      * Pad this out to 32 bytes for cache and indexing reasons.
46      */
47     typedef struct {
48     	unsigned int status;		/* IRQ status */
49     	hw_irq_controller *handler;
50     	struct irqaction *action;	/* IRQ action list */
51     	unsigned int depth;		/* nested irq disables */
52     	spinlock_t lock;
53     } ____cacheline_aligned irq_desc_t;
54     
55     extern irq_desc_t irq_desc [NR_IRQS];
56     
57     #include <asm/hw_irq.h> /* the arch dependent stuff */
58     
59     extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
60     extern int setup_irq(unsigned int , struct irqaction * );
61     
62     extern hw_irq_controller no_irq_type;  /* needed in every arch ? */
63     extern void no_action(int cpl, void *dev_id, struct pt_regs *regs);
64     
65     #endif /* __asm_h */
66