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