5 * Please do not include this file in generic code. There is currently
6 * no requirement for any architecture to implement anything held
12 #include <linux/config.h>
14 #if !defined(CONFIG_ARCH_S390)
16 #include <linux/linkage.h>
17 #include <linux/cache.h>
18 #include <linux/spinlock.h>
19 #include <linux/cpumask.h>
22 #include <asm/ptrace.h>
27 #define IRQ_INPROGRESS 1 /* IRQ handler active - do not enter! */
28 #define IRQ_DISABLED 2 /* IRQ disabled - do not enter! */
29 #define IRQ_PENDING 4 /* IRQ pending - replay on enable */
30 #define IRQ_REPLAY 8 /* IRQ has been replayed but not acked yet */
31 #define IRQ_AUTODETECT 16 /* IRQ is being autodetected */
32 #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */
33 #define IRQ_LEVEL 64 /* IRQ level triggered */
34 #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */
35 #define IRQ_PER_CPU 256 /* IRQ is per CPU */
38 * Interrupt controller descriptor. This is all we need
39 * to describe about the low-level hardware.
41 struct hw_interrupt_type
{
42 const char * typename
;
43 unsigned int (*startup
)(unsigned int irq
);
44 void (*shutdown
)(unsigned int irq
);
45 void (*enable
)(unsigned int irq
);
46 void (*disable
)(unsigned int irq
);
47 void (*ack
)(unsigned int irq
);
48 void (*end
)(unsigned int irq
);
49 void (*set_affinity
)(unsigned int irq
, cpumask_t dest
);
52 typedef struct hw_interrupt_type hw_irq_controller
;
55 * This is the "IRQ descriptor", which contains various information
56 * about the irq, including what kind of hardware handling it has,
57 * whether it is disabled etc etc.
59 * Pad this out to 32 bytes for cache and indexing reasons.
61 typedef struct irq_desc
{
62 hw_irq_controller
*handler
;
64 struct irqaction
*action
; /* IRQ action list */
65 unsigned int status
; /* IRQ status */
66 unsigned int depth
; /* nested irq disables */
67 unsigned int irq_count
; /* For detecting broken interrupts */
68 unsigned int irqs_unhandled
;
70 } ____cacheline_aligned irq_desc_t
;
72 extern irq_desc_t irq_desc
[NR_IRQS
];
74 #include <asm/hw_irq.h> /* the arch dependent stuff */
76 extern int setup_irq(unsigned int irq
, struct irqaction
* new);
78 #ifdef CONFIG_GENERIC_HARDIRQS
79 extern cpumask_t irq_affinity
[NR_IRQS
];
80 extern int no_irq_affinity
;
81 extern int noirqdebug_setup(char *str
);
83 extern fastcall
int handle_IRQ_event(unsigned int irq
, struct pt_regs
*regs
,
84 struct irqaction
*action
);
85 extern fastcall
unsigned int __do_IRQ(unsigned int irq
, struct pt_regs
*regs
);
86 extern void note_interrupt(unsigned int irq
, irq_desc_t
*desc
, int action_ret
);
87 extern void report_bad_irq(unsigned int irq
, irq_desc_t
*desc
, int action_ret
);
88 extern int can_request_irq(unsigned int irq
, unsigned long irqflags
);
90 extern void init_irq_proc(void);
93 extern hw_irq_controller no_irq_type
; /* needed in every arch ? */