Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / include / asm-ia64 / irq.h
1 #ifndef _ASM_IA64_IRQ_H
2 #define _ASM_IA64_IRQ_H
3
4 /*
5  * Copyright (C) 1999-2000, 2002 Hewlett-Packard Co
6  *      David Mosberger-Tang <davidm@hpl.hp.com>
7  *      Stephane Eranian <eranian@hpl.hp.com>
8  *
9  * 11/24/98     S.Eranian       updated TIMER_IRQ and irq_canonicalize
10  * 01/20/99     S.Eranian       added keyboard interrupt
11  * 02/29/00     D.Mosberger     moved most things into hw_irq.h
12  */
13
14 #ifndef CONFIG_XEN
15 #define NR_IRQS         256
16 #define NR_IRQ_VECTORS  NR_IRQS
17 #else
18 /*
19  * The flat IRQ space is divided into two regions:
20  *  1. A one-to-one mapping of real physical IRQs. This space is only used
21  *     if we have physical device-access privilege. This region is at the 
22  *     start of the IRQ space so that existing device drivers do not need
23  *     to be modified to translate physical IRQ numbers into our IRQ space.
24  *  3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These
25  *     are bound using the provided bind/unbind functions.
26  */
27
28 #define PIRQ_BASE               0
29 #define NR_PIRQS                256
30
31 #define DYNIRQ_BASE             (PIRQ_BASE + NR_PIRQS)
32 #define NR_DYNIRQS              256
33
34 #define NR_IRQS                 (NR_PIRQS + NR_DYNIRQS)
35 #define NR_IRQ_VECTORS          NR_IRQS
36
37 #define pirq_to_irq(_x)         ((_x) + PIRQ_BASE)
38 #define irq_to_pirq(_x)         ((_x) - PIRQ_BASE)
39
40 #define dynirq_to_irq(_x)       ((_x) + DYNIRQ_BASE)
41 #define irq_to_dynirq(_x)       ((_x) - DYNIRQ_BASE)
42
43 #define RESCHEDULE_VECTOR       0
44 #define IPI_VECTOR              1
45 #define NR_IPIS                 2
46 #endif /* CONFIG_XEN */
47
48 static __inline__ int
49 irq_canonicalize (int irq)
50 {
51         /*
52          * We do the legacy thing here of pretending that irqs < 16
53          * are 8259 irqs.  This really shouldn't be necessary at all,
54          * but we keep it here as serial.c still uses it...
55          */
56         return ((irq == 2) ? 9 : irq);
57 }
58
59 extern void disable_irq (unsigned int);
60 extern void disable_irq_nosync (unsigned int);
61 extern void enable_irq (unsigned int);
62 extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
63
64 #endif /* _ASM_IA64_IRQ_H */