6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <asm/atomic.h>
15 * Maximum number of interrupt sources that we can handle.
19 extern void disable_irq(unsigned int);
20 extern void disable_irq_nosync(unsigned int);
21 extern void enable_irq(unsigned int);
23 /* this number is used when no interrupt has been assigned */
26 #define get_irq_desc(irq) (&irq_desc[(irq)])
28 /* Define a way to iterate across irqs. */
29 #define for_each_irq(i) \
30 for ((i) = 0; (i) < NR_IRQS; ++(i))
32 /* Interrupt numbers are virtual in case they are sparsely
33 * distributed by the hardware.
35 extern unsigned int virt_irq_to_real_map[NR_IRQS];
37 /* Create a mapping for a real_irq if it doesn't already exist.
38 * Return the virtual irq as a convenience.
40 int virt_irq_create_mapping(unsigned int real_irq);
41 void virt_irq_init(void);
43 static inline unsigned int virt_irq_to_real(unsigned int virt_irq)
45 return virt_irq_to_real_map[virt_irq];
49 * Because many systems have two overlapping names spaces for
50 * interrupts (ISA and XICS for example), and the ISA interrupts
51 * have historically not been easy to renumber, we allow ISA
52 * interrupts to take values 0 - 15, and shift up the remaining
55 #define NUM_ISA_INTERRUPTS 0x10
56 extern int __irq_offset_value;
58 static inline int irq_offset_up(int irq)
60 return(irq + __irq_offset_value);
63 static inline int irq_offset_down(int irq)
65 return(irq - __irq_offset_value);
68 static inline int irq_offset_value(void)
70 return __irq_offset_value;
73 static __inline__ int irq_canonicalize(int irq)
80 int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
82 #endif /* _ASM_IRQ_H */
83 #endif /* __KERNEL__ */