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#include <linux/config.h> 13 14#if !defined(CONFIG_ARCH_S390) 15 16#include <linux/cache.h> 17#include <linux/spinlock.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 */ 39struct 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, unsigned long mask); 48}; 49 50typedef 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 */ 59typedef struct { 60 unsigned int status; /* IRQ status */ 61 hw_irq_controller *handler; 62 struct irqaction *action; /* IRQ action list */ 63 unsigned int depth; /* nested irq disables */ 64 spinlock_t lock; 65} ____cacheline_aligned irq_desc_t; 66 67extern irq_desc_t irq_desc [NR_IRQS]; 68 69#include <asm/hw_irq.h> /* the arch dependent stuff */ 70 71extern int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); 72extern int setup_irq(unsigned int , struct irqaction * ); 73 74extern hw_irq_controller no_irq_type; /* needed in every arch ? */ 75extern void no_action(int cpl, void *dev_id, struct pt_regs *regs); 76 77#endif 78 79#endif /* __irq_h */ 80